Skip to content

Request a minor GC if marking has failed to start since the last slice. #3333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions runtime/major_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1799,12 +1799,18 @@ static void major_collection_slice(intnat howmuch,

if (domain_state->sweeping_done) {
/* We do not immediately trigger a minor GC, but instead wait for
the next one to happen normally. This gives some chance that
other domains will finish sweeping as well. */
the next one to happen normally, when marking will start. This
gives some chance that other domains will finish sweeping as
well. */
request_mark_phase();
/* If there was no sweeping to do, but marking hasn't started,
then minor GC has not occurred naturally between major slices -
so we should force one now. */
if (sweep_work == 0 && !caml_marking_started()) {
caml_request_minor_gc();
}
}


mark_again:
if (caml_marking_started() &&
!domain_state->marking_done &&
Expand Down
Loading