Class ObjectSizeOfAgent
- java.lang.Object
-
- org.apache.wicket.util.instrument.ObjectSizeOfAgent
-
public class ObjectSizeOfAgent extends Object
Instrumentation agent for calculating object sizes using Java's instrumentation API. To use it, have the jar somewhere we you can access it (just having this class on the classpath is not enough) and startup your application with a -javaagent argument like e.g: '-javaagent:/mydir/wicket-objectsizeof-agent-1.3-SNAPSHOT.jar'. When the application starts up, this agent will register anWicketObjects.IObjectSizeOfStrategy
atWicketObjects.setObjectSizeOfStrategy(IObjectSizeOfStrategy)
. Note that this is a static registration.- Author:
- eelcohillenius
-
-
Constructor Summary
Constructors Constructor Description ObjectSizeOfAgent()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
agentmain(String agentArgs, Instrumentation instrumentation)
Initializes agent when it is attached to an already running JVM.static void
premain(String agentArgs, Instrumentation instrumentation)
Initializes agent before the main function of the application is executed.
-
-
-
Constructor Detail
-
ObjectSizeOfAgent
public ObjectSizeOfAgent()
-
-
Method Detail
-
agentmain
public static void agentmain(String agentArgs, Instrumentation instrumentation)
Initializes agent when it is attached to an already running JVM.- Parameters:
agentArgs
- Arguments passed in to the agentinstrumentation
- The instrumentation class
-
premain
public static void premain(String agentArgs, Instrumentation instrumentation)
Initializes agent before the main function of the application is executed.- Parameters:
agentArgs
- Arguments passed in to the agentinstrumentation
- The instrumentation class
-
-