It is apparent in the heap dump I got when investigating JDK-8345302 that javac compilation of JDK benchmarks corpus takes significant memory holding String literals referenced in JMH generated code. About 0.6% of them are these top three:
$ java -jar jol-cli-latest.jar heapdump-strings make/java_pid72581.hprof
Heap dump contains 24.074.729 objects, 1.044.366.688 bytes in total.
=== Duplicate Strings
DUPS: Number of duplicated String instances
SIZE (V): Savings due to String.value dedup (automatic by GC)
SIZE (S+V): Savings due to entire String dedup (manual)
Table is sorted by "DUPS".
Printing first 30 lines. Use -DprintFirst=# to override.
DUPS SIZE (V) SIZE (S+V) VALUE
------------------------------------------------------------------------------------------------
17.511 1.540.968 1.961.232 Yes, I am Stephen Hawking, and k... (69 chars)
17.499 1.399.920 1.819.896 Harness failed to distribute thr... (58 chars)
17.499 1.959.888 2.379.864 Today's password is swordfish. I... (91 chars)
...
------------------------------------------------------------------------------------------------
$ java -jar jol-cli-latest.jar heapdump-strings make/java_pid72581.hprof
Heap dump contains 24.074.729 objects, 1.044.366.688 bytes in total.
=== Duplicate Strings
DUPS: Number of duplicated String instances
SIZE (V): Savings due to String.value dedup (automatic by GC)
SIZE (S+V): Savings due to entire String dedup (manual)
Table is sorted by "DUPS".
Printing first 30 lines. Use -DprintFirst=# to override.
DUPS SIZE (V) SIZE (S+V) VALUE
------------------------------------------------------------------------------------------------
17.511 1.540.968 1.961.232 Yes, I am Stephen Hawking, and k... (69 chars)
17.499 1.399.920 1.819.896 Harness failed to distribute thr... (58 chars)
17.499 1.959.888 2.379.864 Today's password is swordfish. I... (91 chars)
...
------------------------------------------------------------------------------------------------
- relates to
-
JDK-8345302 Building microbenchmarks require larger Java heap
- Resolved
- links to
-
Review(master) openjdk/jmh/139