Always return false for collection_required for NoGC#1263
Always return false for collection_required for NoGC#1263peterzhu2118 wants to merge 1 commit intommtk:masterfrom
Conversation
If we use the dynamic heap with NoGC, it will trigger a GC when `space_full` is true. This will cause a Rust panic of `entered unreachable code: GC triggered in nogc` because `collection_required` returns true.
|
The current behavior of NoGC with dynamic heap sizes is that MMTk panics when the heap meets the current heap size (not the maximum heap size). This is not ideal. With this PR, NoGC will keep allocating, regardless of the heap sizes (dynamic or fixed). I don't think it is correct either. I think the expected behavior for NoGC with dynamic heap sizes is that MMTk keeps allocating until it reaches the maximum heap size. We need to do a bit more refactoring to allow that. |
|
Maybe we can implement a special GC trigger specifically for NoGC with dynamic heap size to handle this. We cannot really use |
|
I agree with @qinsoon. If we simply let And "dynamic" heap size doesn't make sense for NoGC. There could be several solutions.
I prefer the second approach. |
We can just check here and if the plan is NoGC, we just create a mmtk-core/src/util/heap/gc_trigger.rs Lines 43 to 46 in 2f6f078 This is probably cleaner, as we do not need to 'hack' mem balancer. |
|
Thanks for fixing it! |
If we use the dynamic heap with NoGC, it will trigger a GC when
space_fullis true. This will cause a Rust panic ofentered unreachable code: GC triggered in nogcbecausecollection_requiredreturns true.