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

Fixed for assertion failure due to not checking if we are processing Ephemeral Samples in calculate_new_heap_count #105164

Merged
merged 3 commits into from
Jul 25, 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
26 changes: 15 additions & 11 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25402,17 +25402,21 @@ void gc_heap::calculate_new_heap_count ()
// If there was a blocking gen2 GC, the overhead would be very large and most likely we would not pick it. So we
// rely on the gen2 sample's overhead calculated above.
float throughput_cost_percents[dynamic_heap_count_data_t::sample_size];
for (int i = 0; i < dynamic_heap_count_data_t::sample_size; i++)
{
dynamic_heap_count_data_t::sample& sample = dynamic_heap_count_data.samples[i];
assert (sample.elapsed_between_gcs > 0);
throughput_cost_percents[i] = (sample.elapsed_between_gcs ? (((float)sample.msl_wait_time / n_heaps + sample.gc_pause_time) * 100.0f / (float)sample.elapsed_between_gcs) : 0.0f);
assert (throughput_cost_percents[i] >= 0.0);
if (throughput_cost_percents[i] > 100.0)
throughput_cost_percents[i] = 100.0;
dprintf (6666, ("sample %d in GC#%Id msl %I64d / %d + pause %I64d / elapsed %I64d = tcp: %.3f, surv %zd, gc speed %zd/ms", i,
sample.gc_index, sample.msl_wait_time, n_heaps, sample.gc_pause_time, sample.elapsed_between_gcs, throughput_cost_percents[i],
sample.gc_survived_size, (sample.gc_pause_time ? (sample.gc_survived_size * 1000 / sample.gc_pause_time) : 0)));

if (process_eph_samples_p)
mangod9 marked this conversation as resolved.
Show resolved Hide resolved
{
for (int i = 0; i < dynamic_heap_count_data_t::sample_size; i++)
{
dynamic_heap_count_data_t::sample& sample = dynamic_heap_count_data.samples[i];
assert (sample.elapsed_between_gcs > 0);
throughput_cost_percents[i] = (sample.elapsed_between_gcs ? (((float)sample.msl_wait_time / n_heaps + sample.gc_pause_time) * 100.0f / (float)sample.elapsed_between_gcs) : 0.0f);
assert (throughput_cost_percents[i] >= 0.0);
if (throughput_cost_percents[i] > 100.0)
throughput_cost_percents[i] = 100.0;
dprintf (6666, ("sample %d in GC#%Id msl %I64d / %d + pause %I64d / elapsed %I64d = tcp: %.3f, surv %zd, gc speed %zd/ms", i,
sample.gc_index, sample.msl_wait_time, n_heaps, sample.gc_pause_time, sample.elapsed_between_gcs, throughput_cost_percents[i],
sample.gc_survived_size, (sample.gc_pause_time ? (sample.gc_survived_size * 1000 / sample.gc_pause_time) : 0)));
}
}

float median_throughput_cost_percent = median_of_3 (throughput_cost_percents[0], throughput_cost_percents[1], throughput_cost_percents[2]);
Expand Down
Loading