Closed qinsoon closed 6 months ago
Hm. Arguably, initialize_collection
should be called immediately after the threading subsystem of the VM has been set up. What is Julia doing?
Hm. Arguably,
initialize_collection
should be called immediately after the threading subsystem of the VM has been set up. What is Julia doing?
Yeah. But setting up the threading system (and any other system that the threading needs) may require allocation in MMTk. If the allocation exceeds the heap size, we will see this assertion failure.
The actual problem for Julia is the call is_collection_enabled
. is_collection_enabled
means that the VM enables the GC, and initialize_collection
means that the VM is ready to do GC. In theory, the VM should not enable GC before it is ready for GC. But currently the Julia binding returns true for is_collection_enabled
before it calls initialize_collection
, due to the change in https://github.com/mmtk/julia/pull/39. I am fixing this.
This is probably a binding issue, rather than a mmtk-core issue.
This is a binding issue, and was fixed in the Julia binding in https://github.com/mmtk/julia/pull/44.
We should allow allocating before
initialize_collection
is called. See the discussion here: https://github.com/mmtk/mmtk-core/pull/1067#discussion_r1531653341I observed a case in Julia after https://github.com/mmtk/julia/pull/39. I moved the call of
initialize_collection
to a later stage when Julia is actually ready for doing GCs. Depending on the default heap size, we may see the following failure when MMTk attempts to trigger a GC before Julia callsinitialize_collection
.