mmtk / mmtk-core

Memory Management ToolKit
https://www.mmtk.io
Other
374 stars 68 forks source link

Debug is_live() correctness #501

Open qinsoon opened 2 years ago

qinsoon commented 2 years ago

Currently we provide an API is_live_object(object: ObjectReference) -> bool, which is supposed to be used at any time and should return a correct result.

I quickly tested two cases in OpenJDK, and is_live() did not return correct results for all the plans.

Case 1: disable the allocation fastpath, assert if the object we just allocate is live after post_alloc(). Mark sweep failed on this. Case 2: Based on Case 1, further use a stress factor 1, which will trigger a GC for every allocation. Both mark sweep and immix failed on this.

qinsoon commented 11 months ago

We need to clarify that is_live should only be used at certain stages during GC.