Table of Contents

Class ProcessMemory

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

The memory a process holds that belongs to it alone, as the system reports it.

public static class ProcessMemory
Inheritance
ProcessMemory
Inherited Members

Remarks

The working set that Task Manager shows counts memory shared with other processes (the JVM's mapped class data, system libraries) and, on Windows, leaves out heap the JVM committed and has not touched. What the machine really gives up for a server is its private memory, so that is what the RAM card shows, and what the history keeps.

Windows: PrivateMemorySize64, the committed private bytes. Linux: the private pages in smaps_rollup. Elsewhere, and whenever that cannot be read, the working set: a number a little too high is better than none.

ZGC is the exception: on Windows its heap is mapped in a way private bytes do not count, so the reading is far too low. The caller picks the working set for it (see MemoryReadout).

Methods

ParsePrivateKb(string)

The private kilobytes in the text of smaps_rollup, or null when it has none.

public static long? ParsePrivateKb(string smapsRollup)

Parameters

smapsRollup string

Returns

long?

PrivateMb(Process)

The process's private memory in MB, or null when the system will not say.

public static long? PrivateMb(Process process)

Parameters

process Process

Returns

long?

Remarks

Call after Refresh().