runtime/testapps/src/main/java/com/google/apphosting/loadtesting/allinone/MainServlet.java [998:1034]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static void performJmxInfo(PrintWriter w) throws IOException {
    MemoryMXBean memory = ManagementFactory.getMemoryMXBean();
    MemoryUsage heapUsage = memory.getHeapMemoryUsage();
    emitf(w, "heap.init = %d", heapUsage.getInit());
    emitf(w, "heap.used = %d", heapUsage.getUsed());
    emitf(w, "heap.max = %d", heapUsage.getMax());
    emitf(w, "heap.committed = %d", heapUsage.getCommitted());
    MemoryUsage nonHeapUsage = memory.getNonHeapMemoryUsage();
    emitf(w, "non_heap.init = %d", nonHeapUsage.getInit());
    emitf(w, "non_heap.used = %d", nonHeapUsage.getUsed());
    emitf(w, "non_heap.max = %d", nonHeapUsage.getMax());
    emitf(w, "non_heap.committed = %d", nonHeapUsage.getCommitted());
    ClassLoadingMXBean classLoading = ManagementFactory.getClassLoadingMXBean();
    emitf(w, "loaded.classes = %d", classLoading.getLoadedClassCount());
    emitf(w, "unloaded.classes = %d", classLoading.getUnloadedClassCount());
    emitf(w, "total.loaded.classes = %d", classLoading.getTotalLoadedClassCount());
    ThreadMXBean threading = ManagementFactory.getThreadMXBean();
    emitf(w, "thread.count = %d", threading.getThreadCount());
    emitf(w, "daemon.thread.count = %d", threading.getDaemonThreadCount());
    emitf(w, "total.started.thread.count = %d", threading.getTotalStartedThreadCount());
    emitf(w, "peak.thread.count = %d", threading.getPeakThreadCount());
    CompilationMXBean compilation = ManagementFactory.getCompilationMXBean();
    emitf(w, "compiler.time = %d", compilation.getTotalCompilationTime());
    for (GarbageCollectorMXBean gc : ManagementFactory.getGarbageCollectorMXBeans()) {
      String name = gc.getName().replace(" ", "_");
      emitf(w, "gc.%s.count = %d", name, gc.getCollectionCount());
      emitf(w, "gc.%s.time = %d", name, gc.getCollectionTime());
    }
    for (MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) {
      String name = pool.getName().replace(" ", "_");
      emitf(w, "memory.%s.type = %s", name, pool.getType().name().toLowerCase());
      emitf(w, "memory.%s.used = %d", name, pool.getUsage().getUsed());
      emitf(w, "memory.%s.max = %d", name, pool.getUsage().getMax());
      emitf(w, "memory.%s.peak.used = %d", name, pool.getPeakUsage().getUsed());
      emitf(w, "memory.%s.peak.max = %d", name, pool.getPeakUsage().getMax());
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



runtime/testapps/src/main/java/com/google/apphosting/loadtesting/allinone/ee10/MainServlet.java [998:1034]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static void performJmxInfo(PrintWriter w) throws IOException {
    MemoryMXBean memory = ManagementFactory.getMemoryMXBean();
    MemoryUsage heapUsage = memory.getHeapMemoryUsage();
    emitf(w, "heap.init = %d", heapUsage.getInit());
    emitf(w, "heap.used = %d", heapUsage.getUsed());
    emitf(w, "heap.max = %d", heapUsage.getMax());
    emitf(w, "heap.committed = %d", heapUsage.getCommitted());
    MemoryUsage nonHeapUsage = memory.getNonHeapMemoryUsage();
    emitf(w, "non_heap.init = %d", nonHeapUsage.getInit());
    emitf(w, "non_heap.used = %d", nonHeapUsage.getUsed());
    emitf(w, "non_heap.max = %d", nonHeapUsage.getMax());
    emitf(w, "non_heap.committed = %d", nonHeapUsage.getCommitted());
    ClassLoadingMXBean classLoading = ManagementFactory.getClassLoadingMXBean();
    emitf(w, "loaded.classes = %d", classLoading.getLoadedClassCount());
    emitf(w, "unloaded.classes = %d", classLoading.getUnloadedClassCount());
    emitf(w, "total.loaded.classes = %d", classLoading.getTotalLoadedClassCount());
    ThreadMXBean threading = ManagementFactory.getThreadMXBean();
    emitf(w, "thread.count = %d", threading.getThreadCount());
    emitf(w, "daemon.thread.count = %d", threading.getDaemonThreadCount());
    emitf(w, "total.started.thread.count = %d", threading.getTotalStartedThreadCount());
    emitf(w, "peak.thread.count = %d", threading.getPeakThreadCount());
    CompilationMXBean compilation = ManagementFactory.getCompilationMXBean();
    emitf(w, "compiler.time = %d", compilation.getTotalCompilationTime());
    for (GarbageCollectorMXBean gc : ManagementFactory.getGarbageCollectorMXBeans()) {
      String name = gc.getName().replace(" ", "_");
      emitf(w, "gc.%s.count = %d", name, gc.getCollectionCount());
      emitf(w, "gc.%s.time = %d", name, gc.getCollectionTime());
    }
    for (MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) {
      String name = pool.getName().replace(" ", "_");
      emitf(w, "memory.%s.type = %s", name, pool.getType().name().toLowerCase());
      emitf(w, "memory.%s.used = %d", name, pool.getUsage().getUsed());
      emitf(w, "memory.%s.max = %d", name, pool.getUsage().getMax());
      emitf(w, "memory.%s.peak.used = %d", name, pool.getPeakUsage().getUsed());
      emitf(w, "memory.%s.peak.max = %d", name, pool.getPeakUsage().getMax());
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



e2etests/testlocalapps/allinone/src/main/java/allinone/MainServlet.java [989:1025]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static void performJmxInfo(PrintWriter w) throws IOException {
    MemoryMXBean memory = ManagementFactory.getMemoryMXBean();
    MemoryUsage heapUsage = memory.getHeapMemoryUsage();
    emitf(w, "heap.init = %d", heapUsage.getInit());
    emitf(w, "heap.used = %d", heapUsage.getUsed());
    emitf(w, "heap.max = %d", heapUsage.getMax());
    emitf(w, "heap.committed = %d", heapUsage.getCommitted());
    MemoryUsage nonHeapUsage = memory.getNonHeapMemoryUsage();
    emitf(w, "non_heap.init = %d", nonHeapUsage.getInit());
    emitf(w, "non_heap.used = %d", nonHeapUsage.getUsed());
    emitf(w, "non_heap.max = %d", nonHeapUsage.getMax());
    emitf(w, "non_heap.committed = %d", nonHeapUsage.getCommitted());
    ClassLoadingMXBean classLoading = ManagementFactory.getClassLoadingMXBean();
    emitf(w, "loaded.classes = %d", classLoading.getLoadedClassCount());
    emitf(w, "unloaded.classes = %d", classLoading.getUnloadedClassCount());
    emitf(w, "total.loaded.classes = %d", classLoading.getTotalLoadedClassCount());
    ThreadMXBean threading = ManagementFactory.getThreadMXBean();
    emitf(w, "thread.count = %d", threading.getThreadCount());
    emitf(w, "daemon.thread.count = %d", threading.getDaemonThreadCount());
    emitf(w, "total.started.thread.count = %d", threading.getTotalStartedThreadCount());
    emitf(w, "peak.thread.count = %d", threading.getPeakThreadCount());
    CompilationMXBean compilation = ManagementFactory.getCompilationMXBean();
    emitf(w, "compiler.time = %d", compilation.getTotalCompilationTime());
    for (GarbageCollectorMXBean gc : ManagementFactory.getGarbageCollectorMXBeans()) {
      String name = gc.getName().replace(" ", "_");
      emitf(w, "gc.%s.count = %d", name, gc.getCollectionCount());
      emitf(w, "gc.%s.time = %d", name, gc.getCollectionTime());
    }
    for (MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) {
      String name = pool.getName().replace(" ", "_");
      emitf(w, "memory.%s.type = %s", name, pool.getType().name().toLowerCase());
      emitf(w, "memory.%s.used = %d", name, pool.getUsage().getUsed());
      emitf(w, "memory.%s.max = %d", name, pool.getUsage().getMax());
      emitf(w, "memory.%s.peak.used = %d", name, pool.getPeakUsage().getUsed());
      emitf(w, "memory.%s.peak.max = %d", name, pool.getPeakUsage().getMax());
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



e2etests/testlocalapps/allinone_jakarta/src/main/java/allinone/MainServlet.java [1002:1038]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static void performJmxInfo(PrintWriter w) throws IOException {
    MemoryMXBean memory = ManagementFactory.getMemoryMXBean();
    MemoryUsage heapUsage = memory.getHeapMemoryUsage();
    emitf(w, "heap.init = %d", heapUsage.getInit());
    emitf(w, "heap.used = %d", heapUsage.getUsed());
    emitf(w, "heap.max = %d", heapUsage.getMax());
    emitf(w, "heap.committed = %d", heapUsage.getCommitted());
    MemoryUsage nonHeapUsage = memory.getNonHeapMemoryUsage();
    emitf(w, "non_heap.init = %d", nonHeapUsage.getInit());
    emitf(w, "non_heap.used = %d", nonHeapUsage.getUsed());
    emitf(w, "non_heap.max = %d", nonHeapUsage.getMax());
    emitf(w, "non_heap.committed = %d", nonHeapUsage.getCommitted());
    ClassLoadingMXBean classLoading = ManagementFactory.getClassLoadingMXBean();
    emitf(w, "loaded.classes = %d", classLoading.getLoadedClassCount());
    emitf(w, "unloaded.classes = %d", classLoading.getUnloadedClassCount());
    emitf(w, "total.loaded.classes = %d", classLoading.getTotalLoadedClassCount());
    ThreadMXBean threading = ManagementFactory.getThreadMXBean();
    emitf(w, "thread.count = %d", threading.getThreadCount());
    emitf(w, "daemon.thread.count = %d", threading.getDaemonThreadCount());
    emitf(w, "total.started.thread.count = %d", threading.getTotalStartedThreadCount());
    emitf(w, "peak.thread.count = %d", threading.getPeakThreadCount());
    CompilationMXBean compilation = ManagementFactory.getCompilationMXBean();
    emitf(w, "compiler.time = %d", compilation.getTotalCompilationTime());
    for (GarbageCollectorMXBean gc : ManagementFactory.getGarbageCollectorMXBeans()) {
      String name = gc.getName().replace(" ", "_");
      emitf(w, "gc.%s.count = %d", name, gc.getCollectionCount());
      emitf(w, "gc.%s.time = %d", name, gc.getCollectionTime());
    }
    for (MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) {
      String name = pool.getName().replace(" ", "_");
      emitf(w, "memory.%s.type = %s", name, pool.getType().name().toLowerCase());
      emitf(w, "memory.%s.used = %d", name, pool.getUsage().getUsed());
      emitf(w, "memory.%s.max = %d", name, pool.getUsage().getMax());
      emitf(w, "memory.%s.peak.used = %d", name, pool.getPeakUsage().getUsed());
      emitf(w, "memory.%s.peak.max = %d", name, pool.getPeakUsage().getMax());
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



