Skip to content

Commit 471fa12

Browse files
committed
Addressed feedback
1 parent b5b09cc commit 471fa12

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

xml/System/GCMemoryInfo.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,12 @@ The memory after `OBJ_D` is not considered part of the `FragmentedBytes` but is
316316
<summary>Gets the physical memory load when the last garbage collection occurred.</summary>
317317
<value>The physical memory load, in bytes, when the last garbage collection occurred.</value>
318318
<remarks>
319-
<para>On Windows, memory load is a field in the [MEMORYSTATUS structure](https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-memorystatus) in bytes that denotes the physical memory that's in use if the process isn't running in a container with a memory limit. Otherwise, it's either the cgroup's physical memory in use or the current process' working set if we are on Windows or somehow can't obtain it from Linux. Corresponding information is given on other operating systems.</para>
319+
<para>When a process is not running in a container or running in a container without a memory limit:
320+
On Windows, the MemoryLoadBytes is obtained from the <see href="/windows/win32/api/winbase/ns-winbase-memorystatus">MEMORYSTATUS structure</see> in bytes divided by the total physical memory.
321+
On Linux, the MemoryLoadBytes is obtained from reading the MemAvailable field from `/proc/meminfo` divided by the total physical memory.</para>
322+
<para>When a process is running in a container with a memory limit:
323+
On Windows, the MemoryLoadBytes is obtained from the <see href="/windows/win32/api/psapi/nf-psapi-getprocessmemoryinfo">PROCESS_MEMORY_COUNTERS structure</see> in bytes divided by the memory limit.
324+
On Linux, the MemoryLoadBytes is obtained from the used physical memory via the CGroup Memory Usage file from `/memory.usage_in_bytes` for CGroups v1 and `/memory.current` for CGroups v2 divided by the memory limit.</para>
320325
<para>Data is only brought into physical memory on first touch. If you allocated a big object but haven't actually used it, most of its memory isn't in physical memory. In this case, the allocation won't affect the memory load significantly.</para>
321326
</remarks>
322327
</Docs>

0 commit comments

Comments
 (0)