The code trying to make sure there is space to allocate in after a young collections looks a bit backwards. Currently we have three levels of fall back full GCs doing like this:
1. Upgraded no free regions, will clear soft references, not maximal
2. Satisfy failed alloc #1, will not clearing soft references, not maximal
3. Satisfy failed alloc #2, will clear soft references and maximal
To me it would feel more natural to have:
1. Upgraded, not clear, not maximal
2. Satisfy #1, clear, not maximal
3. Satisfy #2, clear and maximal
We need to investigate this a bit to make sure there is not important reason for clearing the soft references in the first "upgraded" full GC.