Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed documentation for MemoryLoadBytes #10303

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion xml/System/GCMemoryInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,12 @@ The memory after `OBJ_D` is not considered part of the `FragmentedBytes` but is
<summary>Gets the physical memory load when the last garbage collection occurred.</summary>
<value>The physical memory load, in bytes, when the last garbage collection occurred.</value>
<remarks>
<para>On Windows, memory load is a field in the <see href="/windows/win32/api/winbase/ns-winbase-memorystatus">MEMORYSTATUS structure</see>. It's a number between 0 and 100 that specifies the approximate percentage of physical memory that's in use (0 indicates no memory use and 100 indicates full memory use). Corresponding information is given on other operating systems.</para>
<para>When a process is not running in a container or running in a container without a memory limit:
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.
On Linux, the MemoryLoadBytes is obtained from reading the MemAvailable field from `/proc/meminfo` divided by the total physical memory.</para>
<para>When a process is running in a container with a memory limit:
On Windows, the MemoryLoadBytes is obtained from the Working Set Size field in the <see href="/windows/win32/api/psapi/nf-psapi-getprocessmemoryinfo">PROCESS_MEMORY_COUNTERS structure</see> in bytes divided by the memory limit.
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>
<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>
</remarks>
</Docs>
Expand Down