public static OptionalLong getMemoryUsageAfterLastGC() {
    var lastGcPoolSizes = postGcMemoryUsage.get();
    if (lastGcPoolSizes.isEmpty()) {
      return OptionalLong.empty();
    } else {
      return OptionalLong.of(lastGcPoolSizes.values().stream().mapToLong(l -> l).sum());
    }
  }
Returns the total memory usage in bytes after last GC, or empty if no GC has occurred yet.
planetiler-core/src/main/java/com/onthegomap/planetiler/stats/ProcessInfo.java