The G1CollectorPolicy constructor uses a huge initializer list. In this list it calls "new SurvRateGroup(this, ..)" passing passing it a reference to the no yet fully initialized G1CollectorPolicy instance.
Via the following call chain, the SurvRateGroup constructor calls back to G1CollectorPolicy::get_new_prediction() which uses the uninitialzed value of G1CollectorPolicy::_sigma:
G1CollectorPolicy::G1CollectorPolicy
SurvRateGroup::SurvRateGroup
SurvRateGroup::reset
SurvRateGroup::all_surviving_words_recorded
G1CollectorPolicy::get_new_prediction
Depending on the indefinite value of '_sigma' this can lead to situations, where a GC is triggered before the whole system is initialized and ready for a GC resulting in the following crash:
Error occurred during initialization of VM
GC triggered before VM initialization completed. Try increasing NewSize, current value 5324K.
The fix is trivial - initialize the G1CollectorPolicy members in the right order