Overhead of -XX:+UseContainerSupport
Florian Weimer
fw at deneb.enyo.de
Sun Sep 1 16:55:26 UTC 2019
On OpenJDK 12, running
jshell -J-Xlog:container*=trace
suggests that the container memory amount is not cached at all. (I
use jshell as a non-trivial example program, the issue appears to
affect everything.)
strace also shows lots of openat calls for paths like this one:
/sys/fs/cgroup/memory/user.slice/user-1000.slice/session-1.scope/memory.limit_in_bytes
All this goes away with -XX:-UseContainerSupport, but the default is
enabled.
These calls appear to be triggered by the Hotspot compiler (they go
away with -Xint), so in a sense this is just a warmup effect. But I
do wonder if there is a better way of doing this.
More information about the hotspot-runtime-dev
mailing list