Skip to content

Reference processing efficiency problem #324

@wks

Description

@wks

After we enabled reference processing by default, we have observed performance problem with the current implementation of reference processing.

Image

From the eBPF-generated timeline taken from lusearch executed with the GenImmix plan, we can see that during a nursery GC, the transitive closure time was very short. In comparison, reference processing took a long time, and was not well-parallelized.

One major problem is that the current algorithm requires soft and weak references to be re-scanned after the transitive closure has been expanded (soft reference and finalizer processing). This introduced extra GC phases, and is currently completely sequential.

The obvious solution is applying the optimizations mentioned in our porting guide, that is, merging soft reference processing with the strong closure or treating them as weak references, and merging weak reference processing with finalizer processing. This will handle soft references on the fly during non-emergency GC which can be well-parallelized, and will reduce the number of soft/weak/final/phantom reference processing phases from 4 to 2. See this section for more details.

This is related to #204, i.e. do reference processing in OpenJDK-specific ways.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions