Package org.openjdk.jmh.profile
Class GCProfiler.HotspotAllocationSnapshot
java.lang.Object
org.openjdk.jmh.profile.GCProfiler.HotspotAllocationSnapshot
- Enclosing class:
GCProfiler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long[]
static final GCProfiler.HotspotAllocationSnapshot
private final long[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
HotspotAllocationSnapshot
(long[] threadIds, long[] allocatedBytes) -
Method Summary
Modifier and TypeMethodDescriptionlong
Estimates allocated bytes based on two snapshots.
-
Field Details
-
EMPTY
-
threadIds
private final long[] threadIds -
allocatedBytes
private final long[] allocatedBytes
-
-
Constructor Details
-
HotspotAllocationSnapshot
private HotspotAllocationSnapshot(long[] threadIds, long[] allocatedBytes)
-
-
Method Details
-
subtract
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
-