RFR: 8254699: Suboptimal PreTouchParallelChunkSize defaults and limits [v2]

Amit Pawar github.com+71302734+amitdpawar at openjdk.java.net
Tue Dec 1 16:41:09 UTC 2020


> This PR fixes lower and default value of JVM flag PreTouchParallelChunkSize. Its default value is 1GB and is used by both G1GC and ParallelGC to pretouch the pages. Following test showed that reducing the chunk size improves JVM startup time and GC pause time.
> 
> Tests are: (Test machine 2P 64C/128T with 1TB memory)
> 1. JVM startup time test with AdaptiveSizePolicy disabled: Pretouch 1TB of memory with/without transparent large page support and used time command to measure the time taken.
> Command: time ./jdk/bin/java -XX:+AlwaysPreTouch -XX:+<UseParallelGC or UseG1GC>-Xmx900g -Xms900g -Xmn800g -XX:SurvivorRatio=400 -Xlog:gc*=debug:file=gc.log -XX:ParallelGCThreads=128 -XX:PreTouchParallelChunkSize=<chunk size> -version
> 2. JVM startup and GC pause time test with AdaptiveSizePolicy enabled: SPECjbb composite run with 1TB heap and transparent large page support was enabled.
> 
> Test results are recorded in XL file. [PreTouchParallelChunkSize_TestResults.xlsx](https://github.com/openjdk/jdk/files/5612448/PreTouchParallelChunkSize_TestResults.xlsx)
> 
> Test results shows:
> 1. With AdaptiveSizePolicy disabled.
>     1. G1GC improved upto ~14% on large page disabled and ~5% on enabled.
>     2. ParallelGC improved upto ~15% on large page disabled and ~5% on enabled.
>     3. Tests showed improvement from 64KB for default page size and 2MB for lage page size.
>     4. Please check "JVM_Startup_Summary" sheet in XL file for more detail.
> 
> 2. SPECjbb composite test with UseAdaptiveSizePolicy + UseLargePages enabled.
>    1. Pretouch takes up-to 30-90% less time for memory range 32MB-4GB. This happens because memory less than 1GB also pretouched with multiple threads.
>    2. Same also helps to bring down GC pause time and this is dependent on memory size. Effect is larger when expansion size is smaller.
>    3. Please check SPECjbb_Summary sheet in XL file for more detail.
> 
> Default value of PreTouchParallelChunkSize is changed to 4MB and based your suggestion it can be changed to right value. Please check and review this PR.

Amit Pawar has updated the pull request incrementally with one additional commit since the last revision:

  Reverted changes in pretouchTask.cpp.

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/1503/files
  - new: https://git.openjdk.java.net/jdk/pull/1503/files/8ef5ed7c..ef6fa419

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1503&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1503&range=00-01

  Stats: 16 lines in 1 file changed: 3 ins; 12 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1503.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1503/head:pull/1503

PR: https://git.openjdk.java.net/jdk/pull/1503



More information about the hotspot-gc-dev mailing list