Table of Contents

Class SystemMemory

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

The machine's memory, as the memory budget and the performance advice need it.

public static class SystemMemory
Inheritance
SystemMemory
Inherited Members

Methods

AvailableMb()

The memory the system could give a program right now without swapping, in MB. 0 when it cannot be read, which makes the advice keep quiet about raising a server's memory.

public static long AvailableMb()

Returns

long

Remarks

Windows asks GlobalMemoryStatusEx; Linux reads MemAvailable from /proc/meminfo. Other systems have no cheap, honest answer here, so they have none.

ParseMemAvailableMb(string)

MemAvailable in a /proc/meminfo text, in MB; 0 when it has none.

public static long ParseMemAvailableMb(string meminfo)

Parameters

meminfo string

Returns

long

TotalMb()

The physical memory available to this process, in MB. 0 if it cannot be read.

public static long TotalMb()

Returns

long

Remarks

The runtime's own figure: the installed memory, or a container's limit when there is one, on every system the app runs on, without any platform call.