Skip to content

Handling immix to-space exhaustion when doing opportunistic copying #780

Open
@wenyuzhao

Description

@wenyuzhao

The opportunistic copying function in Immix space does a relaxed check of the heap usage before doing the object forwarding [1], and skips evacuation if the space is full. This does not guarantee that the subsequent copy allocation always succeeds. If two worker threads are trying to do copy allocation when the heap is almost full, both may pass the relaxed check, but one of the workers may either fail the copy allocation or allocate outside of the max heap boundary. Generally, this relaxed heap usage check is based on the assumption that the maximum heap size is a soft limit instead of a hard limit.

Heap size as a soft limit does not work with compressed pointers. With 35-bit address space, when the heap size is set to equal to 32 GB, this must be a hard limit. A byte over the heap boundary will make the pointer compression code overflow.


Potential solution

We can probably make ForwardingWord::forward_object [2] return an Option<ObjectReference> to indicate whether the copy allocation is successful. If the allocation failed after passing the relaxed check, the trace_object code can choose to mark the object in place.

[1] https://github.com/mmtk/mmtk-core/blob/master/src/policy/immix/immixspace.rs#L570
[2] https://github.com/mmtk/mmtk-core/blob/master/src/policy/immix/immixspace.rs#L579

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: BugP-normalPriority: Normal.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions