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
417417 // Remarks:
418418 // If a process runs with a restricted memory limit, it returns the limit. If there's no limit
419419 // 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 );
421421
422422 // Get memory status
423423 // Parameters:
Original file line number Diff line number Diff line change @@ -52808,7 +52808,7 @@ int gc_heap::refresh_memory_limit()
5280852808 size_t old_heap_hard_limit_poh = heap_hard_limit_oh[poh];
5280952809 bool old_hard_limit_config_p = hard_limit_config_p;
5281052810
52811- total_physical_mem = GCToOSInterface::GetPhysicalMemoryLimit (&is_restricted_physical_mem);
52811+ total_physical_mem = GCToOSInterface::GetPhysicalMemoryLimit (&is_restricted_physical_mem, true );
5281252812
5281352813 bool succeed = true;
5281452814
Original file line number Diff line number Diff line change @@ -1121,14 +1121,13 @@ size_t GCToOSInterface::GetVirtualMemoryLimit()
11211121// Remarks:
11221122// If a process runs with a restricted memory limit, it returns the limit. If there's no limit
11231123// 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 )
11251125{
11261126 size_t restricted_limit;
11271127 if (is_restricted)
11281128 *is_restricted = false ;
11291129
1130- // The limit was not cached
1131- if (g_RestrictedPhysicalMemoryLimit == 0 )
1130+ if (g_RestrictedPhysicalMemoryLimit == 0 || refresh)
11321131 {
11331132 restricted_limit = GetRestrictedPhysicalMemoryLimit ();
11341133 VolatileStore (&g_RestrictedPhysicalMemoryLimit, restricted_limit);
Original file line number Diff line number Diff line change @@ -960,7 +960,7 @@ size_t GCToOSInterface::GetVirtualMemoryLimit()
960960// Remarks:
961961// If a process runs with a restricted memory limit, it returns the limit. If there's no limit
962962// 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 )
964964{
965965 if (is_restricted)
966966 *is_restricted = false ;
You can’t perform that action at this time.
0 commit comments