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) \