RFR: JDK-8317683: Add JIT memory statistics [v3]
Thomas Stuefe
stuefe at openjdk.org
Thu Oct 12 13:04:58 UTC 2023
On Thu, 12 Oct 2023 12:02:06 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
> I think it would be nice to be able to set a memory limit per compilation and have the VM abort once that limit is reached. Would that be worth a follow-up RFE?
Sure.
Note that we already have limits via NMT (since https://bugs.openjdk.org/browse/JDK-8291878), so you can kill the VM if the compiler needs too much memory. But its a global limit, not per compilation.
example:
thomas at starfish$ ./images/jdk/bin/java -XX:NativeMemoryTracking=summary -XX:+UnlockDiagnosticVMOptions \
-XX:MallocLimit=compiler:30m -Xcomp -Xbatch -cp $REPROS_JAR de.stuefe.repros.Simple
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (mallocTracker.cpp:120), pid=757307, tid=757321
# fatal error: MallocLimit: reached category "mtCompiler" limit (triggering allocation size: 576B, allocated so far: 30737K, limit: 30720K)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16076#issuecomment-1759525141
More information about the hotspot-compiler-dev
mailing list