Skip to content
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

Reduce committed bytes if mark array commit fails #106400

Merged
merged 1 commit into from
Aug 23, 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
10 changes: 5 additions & 5 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9579,6 +9579,7 @@ int gc_heap::grow_brick_card_tables (uint8_t* start,
#endif //CARD_BUNDLE

size_t alloc_size = card_table_element_layout[total_bookkeeping_elements];
size_t commit_size = 0;
uint8_t* mem = (uint8_t*)GCToOSInterface::VirtualReserve (alloc_size, 0, virtual_reserve_flags);

if (!mem)
Expand All @@ -9592,14 +9593,16 @@ int gc_heap::grow_brick_card_tables (uint8_t* start,

{
// in case of background gc, the mark array will be committed separately (per segment).
size_t commit_size = card_table_element_layout[seg_mapping_table_element + 1];
commit_size = card_table_element_layout[seg_mapping_table_element + 1];

if (!virtual_commit (mem, commit_size, recorded_committed_bookkeeping_bucket))
{
commit_size = 0;
dprintf (GC_TABLE_LOG, ("Table commit failed"));
set_fgm_result (fgm_commit_table, commit_size, uoh_p);
goto fail;
}

}

ct = (uint32_t*)(mem + card_table_element_layout[card_table_element]);
Expand Down Expand Up @@ -9771,6 +9774,7 @@ int gc_heap::grow_brick_card_tables (uint8_t* start,
dprintf (GC_TABLE_LOG, ("GCToOSInterface::VirtualRelease failed"));
assert (!"release failed");
}
reduce_committed_bytes (mem, commit_size, recorded_committed_bookkeeping_bucket, -1, true);
}

return -1;
Expand Down Expand Up @@ -47495,10 +47499,6 @@ void gc_heap::verify_committed_bytes_per_heap()

void gc_heap::verify_committed_bytes()
{
#ifndef USE_REGIONS
// TODO, https://github.com/dotnet/runtime/issues/102706, re-enable the testing after fixing this bug
return;
#endif //!USE_REGIONS
size_t total_committed = 0;
size_t committed_decommit; // unused
size_t committed_free; // unused
Expand Down
Loading