I have a java app running in a docker with flags on OpenJDK8:
-XX:+UseContainerSupport -XX:MaxRAMPercentage=80.0 -XX:NativeMemoryTracking=summary
and I've noticed that Code Cache memory allocation reported by Native Memory Tracking tool exceeds 240MB
(default ReservedCodeCacheSize
value):
jcmd 1 VM.native_memory summary | grep -i code
- Code (reserved=260013KB, committed=60465KB)
which is ~ 254MB
reserved memory. Here's printed flag and java version:
java -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version | grep -i reserved
uintx ReservedCodeCacheSize = 251658240 {pd product}
openjdk version "1.8.0_262"
OpenJDK Runtime Environment (build 1.8.0_262-b10)
OpenJDK 64-Bit Server VM (build 25.262-b10, mixed mode)
My question is if this is expected behavior? If yes, then is it possible to calculate actual limit for the max code cache size?
thanks!