public class JavaAgent
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static long |
getDeepObjectSize(java.lang.Object object)
The size of the object, without any filtering, including all the children objects
|
static java.lang.instrument.Instrumentation |
getInstrumentation()
Returns the instrumentation given by the JVM.
|
static long |
getObjectSize(java.lang.Object object)
Returns the shallow size of the object, including only the size of the object on the heap, not any of the objects it references
|
static void |
premain(java.lang.String args,
java.lang.instrument.Instrumentation instrumentation)
Method run before the main method and before any other classes are loaded
|
public static void premain(java.lang.String args, @NotNull java.lang.instrument.Instrumentation instrumentation)
args
- The full command line, including program name. No parsing is doneinstrumentation
- The java instrumentation given by the JVMpublic static java.lang.instrument.Instrumentation getInstrumentation()
public static long getObjectSize(@NotNull java.lang.Object object)
object
- The object to get the size ofpublic static long getDeepObjectSize(@NotNull java.lang.Object object)
object
- The object to get the size of