oom_history gc_heap::oom_info;
+int gc_heap::oomhist_index_per_heap = 0;
+
+oom_history gc_heap::oomhist_per_heap[max_oom_history_count];
+
fgm_history gc_heap::fgm_result;
size_t gc_heap::allocated_since_last_gc = 0;
ephemeral_heap_segment = 0;
+ oomhist_index_per_heap = 0;
+
freeable_large_heap_segment = 0;
condemned_generation_num = 0;
return new_limit;
}
+void gc_heap::add_to_oom_history_per_heap()
+{
+ oom_history* current_hist = &oomhist_per_heap[oomhist_index_per_heap];
+ memcpy (current_hist, &oom_info, sizeof (oom_info));
+ oomhist_index_per_heap++;
+ if (oomhist_index_per_heap == max_oom_history_count)
+ {
+ oomhist_index_per_heap = 0;
+ }
+}
+
void gc_heap::handle_oom (int heap_num, oom_reason reason, size_t alloc_size,
uint8_t* allocated, uint8_t* reserved)
{
oom_info.available_pagefile_mb = fgm_result.available_pagefile_mb;
oom_info.loh_p = fgm_result.loh_p;
+ add_to_oom_history_per_heap();
fgm_result.fgm = fgm_no_failure;
// Break early - before the more_space_lock is release so no other threads
if (loh_alloc_state == a_state_cant_allocate)
{
assert (oom_r != oom_no_failure);
- if (should_retry_other_heap (size))
+
+ if ((oom_r != oom_cant_commit) && should_retry_other_heap (size))
{
loh_alloc_state = a_state_retry_allocate;
}