@@ -13484,10 +13484,20 @@ HRESULT gc_heap::initialize_gc (size_t soh_segment_size,
1348413484 if (!reserve_initial_memory (soh_segment_size, loh_segment_size, poh_segment_size, number_of_heaps,
1348513485 use_large_pages_p, separated_poh_p, heap_no_to_numa_node))
1348613486 return E_OUTOFMEMORY;
13487- if (separated_poh_p )
13487+ if (use_large_pages_p )
1348813488 {
13489- heap_hard_limit_oh[poh] = min_segment_size_hard_limit * number_of_heaps;
13490- heap_hard_limit += heap_hard_limit_oh[poh];
13489+ if (heap_hard_limit_oh[soh])
13490+ {
13491+ heap_hard_limit_oh[soh] = soh_segment_size * number_of_heaps;
13492+ heap_hard_limit_oh[loh] = loh_segment_size * number_of_heaps;
13493+ heap_hard_limit_oh[poh] = poh_segment_size * number_of_heaps;
13494+ heap_hard_limit = heap_hard_limit_oh[soh] + heap_hard_limit_oh[loh] + heap_hard_limit_oh[poh];
13495+ }
13496+ else
13497+ {
13498+ assert (heap_hard_limit);
13499+ heap_hard_limit = (soh_segment_size + loh_segment_size + poh_segment_size) * number_of_heaps;
13500+ }
1349113501 }
1349213502#endif //USE_REGIONS
1349313503
@@ -44802,10 +44812,6 @@ HRESULT GCHeap::Initialize()
4480244812
4480344813#endif //HOST_64BIT
4480444814 GCConfig::SetGCLargePages(gc_heap::use_large_pages_p);
44805- GCConfig::SetGCHeapHardLimit(static_cast<int64_t>(gc_heap::heap_hard_limit));
44806- GCConfig::SetGCHeapHardLimitSOH(static_cast<int64_t>(gc_heap::heap_hard_limit_oh[soh]));
44807- GCConfig::SetGCHeapHardLimitLOH(static_cast<int64_t>(gc_heap::heap_hard_limit_oh[loh]));
44808- GCConfig::SetGCHeapHardLimitPOH(static_cast<int64_t>(gc_heap::heap_hard_limit_oh[poh]));
4480944815
4481044816 uint32_t nhp = 1;
4481144817 uint32_t nhp_from_config = 0;
@@ -44960,6 +44966,11 @@ HRESULT GCHeap::Initialize()
4496044966 hr = gc_heap::initialize_gc (seg_size, large_seg_size, pin_seg_size);
4496144967#endif //MULTIPLE_HEAPS
4496244968
44969+ GCConfig::SetGCHeapHardLimit(static_cast<int64_t>(gc_heap::heap_hard_limit));
44970+ GCConfig::SetGCHeapHardLimitSOH(static_cast<int64_t>(gc_heap::heap_hard_limit_oh[soh]));
44971+ GCConfig::SetGCHeapHardLimitLOH(static_cast<int64_t>(gc_heap::heap_hard_limit_oh[loh]));
44972+ GCConfig::SetGCHeapHardLimitPOH(static_cast<int64_t>(gc_heap::heap_hard_limit_oh[poh]));
44973+
4496344974 if (hr != S_OK)
4496444975 return hr;
4496544976
0 commit comments