Details
-
Bug
-
Status: Open
-
P4
-
Resolution: Unresolved
-
9, 10, 11, 12, 13, 14, 15, 16
Description
We noticed a large slowdown from ManagementFactory.getGarbageCollectorMXBeans() comparing JDK 8 and JDK 11. The culprit is probably JDK-8065213, which changes it to call stream().flatMap().collect() underneath.
Using the attached simple loop program, with -XX:-TieredCompilation, JDK 8 takes ~0.2 seconds, JDK 11 takes ~4.5 seconds.
This method is important for some programs that repeatedly call it to collect statistics about GC. Such a program could cache the returned list of this method. However, according to JavaDocs, the JVM "may add or remove GarbageCollectorMXBean during execution", so caching is not an ideal solution.
Using the attached simple loop program, with -XX:-TieredCompilation, JDK 8 takes ~0.2 seconds, JDK 11 takes ~4.5 seconds.
This method is important for some programs that repeatedly call it to collect statistics about GC. Such a program could cache the returned list of this method. However, according to JavaDocs, the JVM "may add or remove GarbageCollectorMXBean during execution", so caching is not an ideal solution.