JDK 21 | JDK 23 |
---|---|
21.0.4-oracleFixed | 23 b09Fixed |
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
AlwaysPreTouch requires all freshly committed pages to be pre-touched. While currently PS GC does not pre-touch heap pages with -XX:+AlwaysPreTouch. This issue is related to JDK-8315923, which fixes it when huge pages are used. But the bug still stands if regular page are used. For example, on linux we can reproduce this bug when /sys/kernel/mm/transparent_hugepage/enabled is madvise or never, but cannot reproduce when it is always. A simple way to reproduce, please make sure large pages are NOT used. Just run a test with the following parameters -XX:+AlwaysPreTouch -Xms31g -Xmx31g -XX:+UseParallelGC There is no pre-touching during heap initialing stage. After initialization, RSS of the test process is much smaller than memory committed. On the contrary, using -XX:+UseG1GC and run the test again -XX:+AlwaysPreTouch -Xms31g -Xmx31g -XX:+UseG1GC it takes several seconds to pre-touch heap pages during initialization, and RSS usage after initialization is similar to memory committed. This is the expected behavior of AlwaysPreTouch This issue related to JDK-8283935, which uses alignment() instead of os::vm_page_size() as pre-touching step size. The value of alignment() is usually bigger than OS page size, which causes most heap pages are not pre-touched.
|