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
startMemorySessionStart
Properties
CeilingMb
The heap ceiling this run started with, in MB.
public long CeilingMb { get; }
Property Value
Collector
The collector the JVM reported; unknown until its first log line.
public GcCollector Collector { get; }
Property Value
CommittedMb
Heap the JVM held at the latest collection that says, in MB. 0 before the first.
public long CommittedMb { get; }
Property Value
FullGcsNotForced
Full collections so far, not counting ones somebody forced.
public int FullGcsNotForced { get; }
Property Value
HasData
True when there is anything worth keeping about this run.
public bool HasData { get; }
Property Value
LiveMb
Heap in use after the latest collection that tells, in MB. 0 before the first.
public long LiveMb { get; }
Property Value
OutOfMemory
True once the server has reported running out of memory.
public bool OutOfMemory { get; }
Property Value
Pressured
True once the server was found short of memory.
public bool Pressured { get; }
Property Value
TotalPauseMs
All the time the application has been paused for collection, in ms.
public double TotalPauseMs { get; }
Property Value
Methods
Add(GcEvent)
Takes in one collection from the log.
public void Add(GcEvent e)
Parameters
eGcEvent
AddSample(long, int)
Takes in one reading of the process from outside.
public void AddSample(long privateMb, int players)
Parameters
Finish(DateTime, SessionEnd)
The run, as it will be remembered.
public MemorySession Finish(DateTime endUtc, SessionEnd end)
Parameters
endUtcDateTimeendSessionEnd
Returns
NoteCollector(GcCollector)
Notes the collector the JVM says it uses.
public void NoteCollector(GcCollector collector)
Parameters
collectorGcCollector
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()