public static OptionalLong getSystemMemoryBytes() {
    if (ManagementFactory.getOperatingSystemMXBean() instanceof com.sun.management.OperatingSystemMXBean osBean) {
      return OptionalLong.of(osBean.getTotalMemorySize());
    } else {
      return OptionalLong.empty();
    }
  }
Returns the total amount of memory available on the system if available.
planetiler-core/src/main/java/com/onthegomap/planetiler/stats/ProcessInfo.java