Package org.openjdk.jmh.profile
Class GCProfiler.HotspotAllocationSnapshot
- java.lang.Object
-
- org.openjdk.jmh.profile.GCProfiler.HotspotAllocationSnapshot
-
- Enclosing class:
- GCProfiler
static class GCProfiler.HotspotAllocationSnapshot extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private long[]
allocatedBytes
static GCProfiler.HotspotAllocationSnapshot
EMPTY
private long[]
threadIds
-
Constructor Summary
Constructors Modifier Constructor Description private
HotspotAllocationSnapshot(long[] threadIds, long[] allocatedBytes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
subtract(GCProfiler.HotspotAllocationSnapshot other)
Estimates allocated bytes based on two snapshots.
-
-
-
Field Detail
-
EMPTY
public static final GCProfiler.HotspotAllocationSnapshot EMPTY
-
threadIds
private final long[] threadIds
-
allocatedBytes
private final long[] allocatedBytes
-
-
Method Detail
-
subtract
public long subtract(GCProfiler.HotspotAllocationSnapshot other)
Estimates allocated bytes based on two snapshots. The problem is threads can come and go while performing the benchmark, thus we would miss allocations made in a thread that was created and died between the snapshots.Current thread is intentionally excluded since it believed to execute jmh infrastructure code only.
- Returns:
- estimated number of allocated bytes between profiler calls
-
-