(This is a break-out from JDK-8365927):
If G1 fails to allocate refinement threads, it starts shutting down the VM.
During shut down it checks that the thread array at positions after the failing thread where it keeps track of them are uninitialized (nullptr).
However, since the thread array is not initialized to nullptr beforehand, G1 fails that assert because that C-heap allocated data structure may be partially uninitialized.
This has been fixed in 23+ due to changes in that area (afaict)
If G1 fails to allocate refinement threads, it starts shutting down the VM.
During shut down it checks that the thread array at positions after the failing thread where it keeps track of them are uninitialized (nullptr).
However, since the thread array is not initialized to nullptr beforehand, G1 fails that assert because that C-heap allocated data structure may be partially uninitialized.
This has been fixed in 23+ due to changes in that area (afaict)