public final class AllocSpy extends Object implements AutoCloseable
Using this facility requires using -javaagent on the command line. For example:
mx --vm server unittest -javaagent:lib/java-allocation-instrumenter.jar -dsa -DAllocSpy.ContextSize=6 BC_iadd2
SampleBytes
,
SampleInstances
,
HistogramLimit
,
NameSize
,
BarSize
,
NumberSize
Modifier and Type | Class and Description |
---|---|
(package private) static class |
AllocSpy.CountedValue
A value and a frequency.
|
(package private) static class |
AllocSpy.GraalContextSampler |
Modifier and Type | Field and Description |
---|---|
private static int |
BarSize
The width of the histogram bar column.
|
(package private) Map<String,AllocSpy.CountedValue> |
bytesPerGraalContext |
private static int |
ContextSize
The size of context to record for each allocation site in terms of Graal frames.
|
(package private) static ThreadLocal<AllocSpy> |
current |
private static boolean |
ENABLED |
private static String[] |
Excluded |
private static int |
HistogramLimit
Only the
HistogramLimit most frequent values are printed. |
(package private) Map<String,AllocSpy.CountedValue> |
instancesPerGraalContext |
(package private) Object |
name |
private static int |
NameSize
The width of the allocation context column.
|
private static int |
NumberSize
The width of the frequency column.
|
(package private) AllocSpy |
parent |
private static boolean |
SampleBytes
Determines if bytes per allocation site are recorded.
|
private static boolean |
SampleInstances
Determines if allocations per allocation site are recorded.
|
Modifier and Type | Method and Description |
---|---|
(package private) AllocSpy.CountedValue |
bytesPerGraalContext(String context) |
void |
close() |
private static boolean |
excludeFrame(String className) |
protected static AllocSpy.CountedValue |
getCounter(String desc,
Map<String,AllocSpy.CountedValue> map) |
(package private) AllocSpy.CountedValue |
instancesPerGraalContext(String context) |
static boolean |
isEnabled() |
static AllocSpy |
open(Object name) |
private static void |
print(PrintStream ps,
Map<String,AllocSpy.CountedValue> map,
String name,
int limit,
int nameSize,
int barSize) |
private static void |
printLine(PrintStream printStream,
char c,
int lineSize) |
(package private) static String |
prop(String sfx) |
static ThreadLocal<AllocSpy> current
private static final boolean ENABLED
private static final boolean SampleBytes
private static final boolean SampleInstances
private static final int ContextSize
private static final int HistogramLimit
HistogramLimit
most frequent values are printed.private static final int NameSize
private static final int BarSize
private static final int NumberSize
final Map<String,AllocSpy.CountedValue> bytesPerGraalContext
final Map<String,AllocSpy.CountedValue> instancesPerGraalContext
public static boolean isEnabled()
public void close()
close
in interface AutoCloseable
private static void printLine(PrintStream printStream, char c, int lineSize)
private static void print(PrintStream ps, Map<String,AllocSpy.CountedValue> map, String name, int limit, int nameSize, int barSize)
AllocSpy.CountedValue bytesPerGraalContext(String context)
AllocSpy.CountedValue instancesPerGraalContext(String context)
protected static AllocSpy.CountedValue getCounter(String desc, Map<String,AllocSpy.CountedValue> map)
private static boolean excludeFrame(String className)