Table of Contents

Class MemorySessionTracker

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

Gathers a run's memory measurements as they arrive, and turns them into one MemorySession when it ends.

public sealed class MemorySessionTracker
Inheritance
MemorySessionTracker
Inherited Members

Remarks

Pure and without a clock: times come in as arguments, so a test can say exactly when things happened. It does no I/O and keeps no list that grows with the run: the live-heap readings go into a histogram of one-megabyte steps, so a month-long run costs what an hour does.

Constructors

MemorySessionTracker(MemorySessionStart)

public MemorySessionTracker(MemorySessionStart start)

Parameters

start MemorySessionStart

Properties

CeilingMb

The heap ceiling this run started with, in MB.

public long CeilingMb { get; }

Property Value

long

Collector

The collector the JVM reported; unknown until its first log line.

public GcCollector Collector { get; }

Property Value

GcCollector

CommittedMb

Heap the JVM held at the latest collection that says, in MB. 0 before the first.

public long CommittedMb { get; }

Property Value

long

FullGcsNotForced

Full collections so far, not counting ones somebody forced.

public int FullGcsNotForced { get; }

Property Value

int

HasData

True when there is anything worth keeping about this run.

public bool HasData { get; }

Property Value

bool

LiveMb

Heap in use after the latest collection that tells, in MB. 0 before the first.

public long LiveMb { get; }

Property Value

long

OutOfMemory

True once the server has reported running out of memory.

public bool OutOfMemory { get; }

Property Value

bool

Pressured

True once the server was found short of memory.

public bool Pressured { get; }

Property Value

bool

TotalPauseMs

All the time the application has been paused for collection, in ms.

public double TotalPauseMs { get; }

Property Value

double

Methods

Add(GcEvent)

Takes in one collection from the log.

public void Add(GcEvent e)

Parameters

e GcEvent

AddSample(long, int)

Takes in one reading of the process from outside.

public void AddSample(long privateMb, int players)

Parameters

privateMb long
players int

Finish(DateTime, SessionEnd)

The run, as it will be remembered.

public MemorySession Finish(DateTime endUtc, SessionEnd end)

Parameters

endUtc DateTime
end SessionEnd

Returns

MemorySession

NoteCollector(GcCollector)

Notes the collector the JVM says it uses.

public void NoteCollector(GcCollector collector)

Parameters

collector GcCollector

NoteOutOfMemory()

Notes that the server reported running out of memory.

public void NoteOutOfMemory()

NotePressure()

Notes that the server was found short of memory.

public void NotePressure()