public static Duration getGcTime() {
    long total = 0;
    for (final GarbageCollectorMXBean gc : ManagementFactory.getGarbageCollectorMXBeans()) {
      total += gc.getCollectionTime();
    }
    return Duration.ofMillis(total);
  }
Returns the amount of time this JVM has spent in any kind of garbage collection since startup.
planetiler-core/src/main/java/com/onthegomap/planetiler/stats/ProcessInfo.java