Relates :
|
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.