Skip to content

Conversation

@wenyuzhao
Copy link
Member

@wenyuzhao wenyuzhao commented Feb 22, 2022

Fix ImmixSpace's is_live and get_forwarded_object for mmtk/mmtk-openjdk#141 .


The context of this PR:

OpenJDK has several object cache (or storage) that should be processed during GC. For example, CodeCache may contain embedded pointers. Our old approach is to treat all the objects in these storages as root pointers -- and caused memory leak. mmtk/mmtk-openjdk#141 tries to update these storages before the end of each GC, including removing dead objects and updating forwarded objects.

To support this. all mmtk spaces should implement is_live and get_forwarded_object correctly.

@tianleq Looks like there's some difficulty implementing get_forwarded_object for MarkCompactSpace? Is it because the MarkCompactSpace does not use object_forwarding?


TODO: MarkCompactSpace needs to be fixed as well...

@tianleq
Copy link
Collaborator

tianleq commented Feb 22, 2022

Yes, markcompact moves objects through a linear scan

@qinsoon
Copy link
Member

qinsoon commented Feb 8, 2023

get_forwarded_object is fixed in #753 for ImmixSpace. Setting mark bit in Immix post_copy is included in master.

fn post_copy(&mut self, obj: ObjectReference, _bytes: usize) {
// Mark the object
VM::VMObjectModel::LOCAL_MARK_BIT_SPEC.store_atomic::<VM, u8>(
obj,
self.get_space().mark_state,
None,
Ordering::SeqCst,
);

We can close this PR.

@qinsoon qinsoon closed this Feb 8, 2023
@k-sareen k-sareen deleted the fix-roots-leak branch April 27, 2023 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants