File tree Expand file tree Collapse file tree 4 files changed +5
-6
lines changed Expand file tree Collapse file tree 4 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -417,7 +417,7 @@ class GCToOSInterface
417
417
// Remarks:
418
418
// If a process runs with a restricted memory limit, it returns the limit. If there's no limit
419
419
// specified, it returns amount of actual physical memory.
420
- static uint64_t GetPhysicalMemoryLimit (bool * is_restricted=NULL );
420
+ static uint64_t GetPhysicalMemoryLimit (bool * is_restricted=NULL , bool refresh= false );
421
421
422
422
// Get memory status
423
423
// Parameters:
Original file line number Diff line number Diff line change @@ -52808,7 +52808,7 @@ int gc_heap::refresh_memory_limit()
52808
52808
size_t old_heap_hard_limit_poh = heap_hard_limit_oh[poh];
52809
52809
bool old_hard_limit_config_p = hard_limit_config_p;
52810
52810
52811
- total_physical_mem = GCToOSInterface::GetPhysicalMemoryLimit (&is_restricted_physical_mem);
52811
+ total_physical_mem = GCToOSInterface::GetPhysicalMemoryLimit (&is_restricted_physical_mem, true );
52812
52812
52813
52813
bool succeed = true;
52814
52814
Original file line number Diff line number Diff line change @@ -1121,14 +1121,13 @@ size_t GCToOSInterface::GetVirtualMemoryLimit()
1121
1121
// Remarks:
1122
1122
// If a process runs with a restricted memory limit, it returns the limit. If there's no limit
1123
1123
// specified, it returns amount of actual physical memory.
1124
- uint64_t GCToOSInterface::GetPhysicalMemoryLimit (bool * is_restricted)
1124
+ uint64_t GCToOSInterface::GetPhysicalMemoryLimit (bool * is_restricted, bool refresh )
1125
1125
{
1126
1126
size_t restricted_limit;
1127
1127
if (is_restricted)
1128
1128
*is_restricted = false ;
1129
1129
1130
- // The limit was not cached
1131
- if (g_RestrictedPhysicalMemoryLimit == 0 )
1130
+ if (g_RestrictedPhysicalMemoryLimit == 0 || refresh)
1132
1131
{
1133
1132
restricted_limit = GetRestrictedPhysicalMemoryLimit ();
1134
1133
VolatileStore (&g_RestrictedPhysicalMemoryLimit, restricted_limit);
Original file line number Diff line number Diff line change @@ -960,7 +960,7 @@ size_t GCToOSInterface::GetVirtualMemoryLimit()
960
960
// Remarks:
961
961
// If a process runs with a restricted memory limit, it returns the limit. If there's no limit
962
962
// specified, it returns amount of actual physical memory.
963
- uint64_t GCToOSInterface::GetPhysicalMemoryLimit (bool * is_restricted)
963
+ uint64_t GCToOSInterface::GetPhysicalMemoryLimit (bool * is_restricted, bool refresh )
964
964
{
965
965
if (is_restricted)
966
966
*is_restricted = false ;
You can’t perform that action at this time.
0 commit comments