RFR (S): Parallel AlwaysPreTouch

Aleksey Shipilev shade at redhat.com
Mon Oct 10 12:18:16 UTC 2016


It is not unusual for low-latency customers with large heaps to enable
-XX:+AlwaysPreTouch, that touches every page preemptively during the
allocation (e.g. on startup). This pays the upfront cost during startup,
instead of during the execution.

However, pre-touching on larger heaps may take a while, see e.g. G1 on 1
Tb heap reports 10 minutes (!) to init the heap [1]. So, G1 made the
pre-touch parallel. We can do it too:

On my 4-core desktop, -XX:+AlwaysPreTouch HelloWorld with 20 Gb heap
improves 4.5s -> 1.8s. I would expect this improvement to be larger on
mammoth machines.

Note that shared VM changes match the G1 changes [2], which means we
should nicely fit during the next merge.


[1] https://bugs.openjdk.java.net/browse/JDK-8157952
[1] http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/bc2c975bc342

More information about the shenandoah-dev mailing list