Skip to content

Fixed documentation for MemoryLoadBytes #10303

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

Merged
merged 14 commits into from
Jul 28, 2025
Merged
9 changes: 8 additions & 1 deletion xml/System/GCMemoryInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,14 @@ 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:</para>
<para>- 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.</para>
<para>- On Linux, the MemoryLoadBytes is obtained from reading the MemAvailable field from <c>/proc/meminfo</c> divided by the total physical memory.</para>
<para>When a process is running in a container with a memory limit or when cgroup limits are set:</para>
<para>- 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.</para>
<para>- On Linux, the MemoryLoadBytes is obtained from the used physical memory via the CGroup Memory Usage file from <c>memory.usage_in_bytes</c> for CGroups v1 and <c>memory.current</c> for CGroups v2 divided by the memory limit. The cgroup limits don't necessarily mean there is a container. You can use cgroup to set limits on a regular process.</para>
<para>On Linux, when there is no cgroup enabled, the used physical memory is read from the <c>/proc/statm</c> file, which provides the process resident set size.</para>
<para>On Linux, the virtual memory load is also used if the virtual memory rlimit is set and if the load is larger than the physical memory load.</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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy