RFR: 8372948: Store end positions directly in JCTree
Liam Miller-Cushon
cushon at openjdk.org
Thu Dec 4 14:09:26 UTC 2025
On Wed, 3 Dec 2025 19:11:14 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> One more interesting experiment could be to try to enable end position in all trees, then run the JDK build and compare with mainline, to see what the memory usage looks like (maybe enabling -verbose:gc and looking where it peaks).
I attempted this experiment. I ran configure with `--disable-javac-server` and added `-verbose:gc` to the javac args with the change below. Then I made trivial edits to `src/java.base/share/classes/java/lang/String.java` and rebuilt.
With this PR the output was something like
Compiling up to 3385 files for java.base
[0.003s][info][gc] Using G1
[0.239s][info][gc] GC(0) Pause Young (Normal) (G1 Evacuation Pause) 34M->4M(64M) 2.704ms
[0.415s][info][gc] GC(1) Pause Young (Normal) (G1 Evacuation Pause) 31M->10M(64M) 4.419ms
[0.531s][info][gc] GC(2) Pause Young (Normal) (G1 Evacuation Pause) 37M->16M(64M) 4.672ms
[0.568s][info][gc] GC(3) Pause Young (Concurrent Start) (Metadata GC Threshold) 24M->18M(64M) 2.825ms
[0.568s][info][gc] GC(4) Concurrent Mark Cycle
[0.573s][info][gc] GC(4) Pause Remark 19M->19M(64M) 1.349ms
[0.575s][info][gc] GC(4) Pause Cleanup 19M->19M(64M) 0.007ms
[0.575s][info][gc] GC(4) Concurrent Mark Cycle 6.227ms
And without these changes, it looks like it peaked at 36M instead of 37M
[info][gc] GC(2) Pause Young (Normal) (G1 Evacuation Pause) 36M->16M(64M)
---
diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk
index 33f5d10535a..e9a800bce5a 100644
--- a/make/common/JavaCompilation.gmk
+++ b/make/common/JavaCompilation.gmk
@@ -254,7 +254,7 @@ define SetupJavaCompilationBody
javacserver.Main --conf=$$($1_JAVAC_SERVER_CONFIG)
else
# No javac server
- $1_JAVAC := $$(INTERIM_LANGTOOLS_ARGS) -m jdk.compiler.interim/com.sun.tools.javac.Main
+ $1_JAVAC := -verbose:gc $$(INTERIM_LANGTOOLS_ARGS) -m jdk.compiler.interim/com.sun.tools.javac.Main
ifeq ($$($1_SMALL_JAVA), true)
$1_JAVAC_CMD := $$(JAVA_SMALL) $$($1_JAVA_FLAGS) $$($1_JAVAC)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28610#issuecomment-3612431977
More information about the compiler-dev
mailing list