JDK-8145204 : JVM can hang when ParGCArrayScanChunk=4294967296 and ParallelGC is used
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-12-11
  • Updated: 2018-06-21
  • Resolved: 2016-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b112Fixed
Related Reports
Relates :  
Description
ParGCArrayScanChunk is assigned to '_array_chunk_size' in PSPromotionManager::PSPromotionManager() constructor(hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp module):
  _array_chunk_size = ParGCArrayScanChunk;

 _array_chunk_size have type uint(hotspot/src/share/vm/gc/parallel/psPromotionManager.hpp module):
class PSPromotionManager VALUE_OBJ_CLASS_SPEC {
...
  uint                                _array_chunk_size;
...

ParGCArrayScanChunk have intx type. Thus, on 64 bit JVM _array_chunk_size can overflow if ParGCArrayScanChunk is greater than maximum unsigned 32 bit number. For example for ParGCArrayScanChunk=4294967296 the '_array_chunk_size' will be equal to 0 and this leads to the hang of the JVM.

Can be reproducible by javac:
javac -J-XX:+UseParallelGC -J-XX:+UseParallelOldGC -J-XX:ParGCArrayScanChunk=4294967296 HelloWorld.java

Also, _array_chunk_size is then multiplied on 1.5.
Also, ParGCArrayScanChunk is multiplied on 2 in CMS and G1 code, thus overflow can occur for big values.
This should be considered for fixing range or constraint for this flag.

I think that new test is not needed, because this flag will be tested for non-G1 GC mode after fixing JDK-8144578.