JDK-8200417 : Change default value of HeapSizePerGCThread
  • Type: CSR
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 11
  • Submitted: 2018-03-29
  • Updated: 2018-04-09
  • Resolved: 2018-04-06
Related Reports
CSR :  
Description
Summary
-------

Improve pause times for small heaps by changing the default value for HeapSizePerGCThread.

Problem
-------

There is ongoing work to improve the resource usage in Hotspot, especially during startup. One of the recent changes in this area was to make UseDynamicNumberOfGCThreads true by default in JDK-8198547.
Since this change the flag HeapSizePerGCThread is now considered when calculating the number of GC threads to use during GC. Recent measurements show that for small heaps the current default value of 64M seems a bit too big. We get can get both shorter young and full collections pause times when decreasing the default value a bit.
We think that 32M is the best tradeoff between resource usage and garbage collection times on a selection of benchmarks for small heaps.

Solution
--------

Change the default value of HeapSizePerGCThread to 32M instead of 64M.

Specification
-------------
   
    --- old/src/hotspot/share/runtime/globals.hpp	2018-03-28 15:47:42.588758908 +0200
    +++ new/src/hotspot/share/runtime/globals.hpp	2018-03-28 15:47:42.264746120 +0200
    @@ -1446,7 +1446,7 @@
               "Force dynamic selection of the number of "                       \
               "parallel threads parallel gc will use to aid debugging")         \
                                                                                 \
    -  product(size_t, HeapSizePerGCThread, ScaleForWordSize(64*M),              \
    +  product(size_t, HeapSizePerGCThread, ScaleForWordSize(32*M),              \
               "Size of heap (bytes) per GC thread used in calculating the "     \
               "number of GC threads")                                           \
               range((size_t)os::vm_page_size(), (size_t)max_uintx)              \
   

Comments
Moving to Approved.
06-04-2018

Given the interest in GC tuning, I recommend creating a release note for this change (or other updating the relevant GC-related documentation).
06-04-2018

Review thread: http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2018-March/021610.html
03-04-2018