@@ -6066,6 +6066,7 @@ void gc_heap::release_segment (heap_segment* sg)
6066
6066
FIRE_EVENT(GCFreeSegment_V1, heap_segment_mem(sg));
6067
6067
size_t reserved_size = (uint8_t*)heap_segment_reserved (sg) - (uint8_t*)sg;
6068
6068
reduce_committed_bytes (
6069
+ 28973,
6069
6070
sg,
6070
6071
((uint8_t*)heap_segment_committed (sg) - (uint8_t*)sg),
6071
6072
(int) heap_segment_oh (sg)
@@ -7289,7 +7290,7 @@ bool gc_heap::virtual_alloc_commit_for_heap (void* addr, size_t size, int h_numb
7289
7290
return GCToOSInterface::VirtualCommit(addr, size);
7290
7291
}
7291
7292
7292
- bool gc_heap::virtual_commit (void* address, size_t size, int bucket, int h_number, bool* hard_limit_exceeded_p)
7293
+ bool gc_heap::virtual_commit (int reason, void* address, size_t size, int bucket, int h_number, bool* hard_limit_exceeded_p)
7293
7294
{
7294
7295
/**
7295
7296
* Here are all the possible cases for the commits:
@@ -7309,7 +7310,7 @@ bool gc_heap::virtual_commit (void* address, size_t size, int bucket, int h_numb
7309
7310
assert(bucket != recorded_committed_free_bucket);
7310
7311
#endif //USE_REGIONS
7311
7312
7312
- STRESS_LOG_VA (1, ("commit-accounting: commit in %d [%p, %p) for heap %d", bucket, address, ((uint8_t*)address + size), h_number));
7313
+ STRESS_LOG_VA (1, ("commit-accounting: commit in %d [%p, %p) for heap %d with reason %d ", bucket, address, ((uint8_t*)address + size), h_number, reason ));
7313
7314
bool should_count =
7314
7315
#ifdef USE_REGIONS
7315
7316
true;
@@ -7402,12 +7403,12 @@ bool gc_heap::virtual_commit (void* address, size_t size, int bucket, int h_numb
7402
7403
return commit_succeeded_p;
7403
7404
}
7404
7405
7405
- void gc_heap::reduce_committed_bytes (void* address, size_t size, int bucket, int h_number, bool decommit_succeeded_p)
7406
+ void gc_heap::reduce_committed_bytes (int reason, void* address, size_t size, int bucket, int h_number, bool decommit_succeeded_p)
7406
7407
{
7407
7408
assert(0 <= bucket && bucket < recorded_committed_bucket_counts);
7408
7409
assert(bucket < total_oh_count || h_number == -1);
7409
7410
7410
- STRESS_LOG_VA (1, ("commit-accounting: decommit in %d [%p, %p) for heap %d", bucket, address, ((uint8_t*)address + size), h_number));
7411
+ STRESS_LOG_VA (1, ("commit-accounting: decommit in %d [%p, %p) for heap %d with reason ", bucket, address, ((uint8_t*)address + size), h_number, reason ));
7411
7412
7412
7413
#ifndef USE_REGIONS
7413
7414
if (bucket != recorded_committed_ignored_bucket)
@@ -7435,7 +7436,7 @@ void gc_heap::reduce_committed_bytes (void* address, size_t size, int bucket, in
7435
7436
}
7436
7437
}
7437
7438
7438
- bool gc_heap::virtual_decommit (void* address, size_t size, int bucket, int h_number)
7439
+ bool gc_heap::virtual_decommit (int reason, void* address, size_t size, int bucket, int h_number)
7439
7440
{
7440
7441
/**
7441
7442
* Here are all possible cases for the decommits:
@@ -7450,7 +7451,7 @@ bool gc_heap::virtual_decommit (void* address, size_t size, int bucket, int h_nu
7450
7451
7451
7452
bool decommit_succeeded_p = ((bucket != recorded_committed_bookkeeping_bucket) && use_large_pages_p) ? true : GCToOSInterface::VirtualDecommit (address, size);
7452
7453
7453
- reduce_committed_bytes (address, size, bucket, h_number, decommit_succeeded_p);
7454
+ reduce_committed_bytes (reason, address, size, bucket, h_number, decommit_succeeded_p);
7454
7455
7455
7456
return decommit_succeeded_p;
7456
7457
}
@@ -9086,7 +9087,7 @@ void gc_heap::destroy_card_table_helper (uint32_t* c_table)
9086
9087
uint8_t* highest = card_table_highest_address (c_table);
9087
9088
get_card_table_element_layout(lowest, highest, card_table_element_layout);
9088
9089
size_t result = card_table_element_layout[seg_mapping_table_element + 1];
9089
- gc_heap::reduce_committed_bytes (&card_table_refcount(c_table), result, recorded_committed_bookkeeping_bucket, -1, true);
9090
+ gc_heap::reduce_committed_bytes (28972, &card_table_refcount(c_table), result, recorded_committed_bookkeeping_bucket, -1, true);
9090
9091
9091
9092
// If we don't put the mark array committed in the ignored bucket, then this is where to account for the decommit of it
9092
9093
}
@@ -9346,7 +9347,7 @@ bool gc_heap::inplace_commit_card_table (uint8_t* from, uint8_t* to)
9346
9347
bool succeed;
9347
9348
if (commit_sizes[i] > 0)
9348
9349
{
9349
- succeed = virtual_commit (commit_begins[i], commit_sizes[i], recorded_committed_bookkeeping_bucket);
9350
+ succeed = virtual_commit (28967, commit_begins[i], commit_sizes[i], recorded_committed_bookkeeping_bucket);
9350
9351
if (!succeed)
9351
9352
{
9352
9353
failed_commit = i;
@@ -9368,7 +9369,7 @@ bool gc_heap::inplace_commit_card_table (uint8_t* from, uint8_t* to)
9368
9369
bool succeed;
9369
9370
if (commit_sizes[i] > 0)
9370
9371
{
9371
- succeed = virtual_decommit (commit_begins[i], commit_sizes[i], recorded_committed_bookkeeping_bucket);
9372
+ succeed = virtual_decommit (28968, commit_begins[i], commit_sizes[i], recorded_committed_bookkeeping_bucket);
9372
9373
assert (succeed);
9373
9374
}
9374
9375
}
@@ -9419,7 +9420,7 @@ uint32_t* gc_heap::make_card_table (uint8_t* start, uint8_t* end)
9419
9420
// in case of background gc, the mark array will be committed separately (per segment).
9420
9421
size_t commit_size = card_table_element_layout[seg_mapping_table_element + 1];
9421
9422
9422
- if (!virtual_commit (mem, commit_size, recorded_committed_bookkeeping_bucket))
9423
+ if (!virtual_commit (28960, mem, commit_size, recorded_committed_bookkeeping_bucket))
9423
9424
{
9424
9425
dprintf (1, ("Card table commit failed"));
9425
9426
GCToOSInterface::VirtualRelease (mem, alloc_size);
@@ -9594,7 +9595,7 @@ int gc_heap::grow_brick_card_tables (uint8_t* start,
9594
9595
// in case of background gc, the mark array will be committed separately (per segment).
9595
9596
size_t commit_size = card_table_element_layout[seg_mapping_table_element + 1];
9596
9597
9597
- if (!virtual_commit (mem, commit_size, recorded_committed_bookkeeping_bucket))
9598
+ if (!virtual_commit (28961, mem, commit_size, recorded_committed_bookkeeping_bucket))
9598
9599
{
9599
9600
dprintf (GC_TABLE_LOG, ("Table commit failed"));
9600
9601
set_fgm_result (fgm_commit_table, commit_size, uoh_p);
@@ -12274,7 +12275,7 @@ heap_segment* gc_heap::make_heap_segment (uint8_t* new_pages, size_t size, gc_he
12274
12275
0;
12275
12276
#endif //MULTIPLE_HEAPS
12276
12277
12277
- if (!virtual_commit (new_pages, initial_commit, oh, h_number))
12278
+ if (!virtual_commit (28962, new_pages, initial_commit, oh, h_number))
12278
12279
{
12279
12280
return 0;
12280
12281
}
@@ -12460,7 +12461,7 @@ size_t gc_heap::decommit_heap_segment_pages_worker (heap_segment* seg,
12460
12461
ptrdiff_t size = heap_segment_committed (seg) - page_start;
12461
12462
if (size > 0)
12462
12463
{
12463
- bool decommit_succeeded_p = virtual_decommit (page_start, (size_t)size, heap_segment_oh (seg), heap_number);
12464
+ bool decommit_succeeded_p = virtual_decommit (28963, page_start, (size_t)size, heap_segment_oh (seg), heap_number);
12464
12465
if (decommit_succeeded_p)
12465
12466
{
12466
12467
dprintf (3, ("Decommitting heap segment [%zx, %zx[(%zd)",
@@ -12501,7 +12502,7 @@ void gc_heap::decommit_heap_segment (heap_segment* seg)
12501
12502
12502
12503
assert (heap_segment_committed (seg) >= page_start);
12503
12504
size_t size = heap_segment_committed (seg) - page_start;
12504
- bool decommit_succeeded_p = virtual_decommit (page_start, size, heap_segment_oh (seg), heap_number);
12505
+ bool decommit_succeeded_p = virtual_decommit (28964, page_start, size, heap_segment_oh (seg), heap_number);
12505
12506
12506
12507
if (decommit_succeeded_p)
12507
12508
{
@@ -13269,7 +13270,7 @@ void gc_heap::distribute_free_regions()
13269
13270
size_t end_space = heap_segment_committed (region) - aligned_allocated;
13270
13271
if (end_space > 0)
13271
13272
{
13272
- virtual_decommit (aligned_allocated, end_space, gen_to_oh (i), hn);
13273
+ virtual_decommit (28969, aligned_allocated, end_space, gen_to_oh (i), hn);
13273
13274
heap_segment_committed (region) = aligned_allocated;
13274
13275
heap_segment_used (region) = min (heap_segment_used (region), heap_segment_committed (region));
13275
13276
assert (heap_segment_committed (region) > heap_segment_mem (region));
@@ -15463,7 +15464,7 @@ BOOL gc_heap::grow_heap_segment (heap_segment* seg, uint8_t* high_address, bool*
15463
15464
"Growing heap_segment: %zx high address: %zx\n",
15464
15465
(size_t)seg, (size_t)high_address);
15465
15466
15466
- bool ret = virtual_commit (heap_segment_committed (seg), c_size, heap_segment_oh (seg), heap_number, hard_limit_exceeded_p);
15467
+ bool ret = virtual_commit (28965, heap_segment_committed (seg), c_size, heap_segment_oh (seg), heap_number, hard_limit_exceeded_p);
15467
15468
if (ret)
15468
15469
{
15469
15470
heap_segment_committed (seg) += c_size;
@@ -37731,7 +37732,7 @@ BOOL gc_heap::commit_mark_array_by_range (uint8_t* begin, uint8_t* end, uint32_t
37731
37732
size));
37732
37733
#endif //SIMPLE_DPRINTF
37733
37734
37734
- if (virtual_commit (commit_start, size, recorded_committed_mark_array_bucket))
37735
+ if (virtual_commit (28966, commit_start, size, recorded_committed_mark_array_bucket))
37735
37736
{
37736
37737
// We can only verify the mark array is cleared from begin to end, the first and the last
37737
37738
// page aren't necessarily all cleared 'cause they could be used by other segments or
@@ -37956,7 +37957,7 @@ void gc_heap::decommit_mark_array_by_seg (heap_segment* seg)
37956
37957
37957
37958
if (decommit_start < decommit_end)
37958
37959
{
37959
- if (!virtual_decommit (decommit_start, size, recorded_committed_mark_array_bucket))
37960
+ if (!virtual_decommit (28970, decommit_start, size, recorded_committed_mark_array_bucket))
37960
37961
{
37961
37962
dprintf (GC_TABLE_LOG, ("decommit on %p for %zd bytes failed",
37962
37963
decommit_start, size));
@@ -44167,7 +44168,7 @@ size_t gc_heap::decommit_region (heap_segment* region, int bucket, int h_number)
44167
44168
uint8_t* page_start = align_lower_page (get_region_start (region));
44168
44169
uint8_t* decommit_end = heap_segment_committed (region);
44169
44170
size_t decommit_size = decommit_end - page_start;
44170
- bool decommit_succeeded_p = virtual_decommit (page_start, decommit_size, bucket, h_number);
44171
+ bool decommit_succeeded_p = virtual_decommit (28971, page_start, decommit_size, bucket, h_number);
44171
44172
bool require_clearing_memory_p = !decommit_succeeded_p || use_large_pages_p;
44172
44173
dprintf (REGIONS_LOG, ("decommitted region %p(%p-%p) (%zu bytes) - success: %d",
44173
44174
region,
0 commit comments