org.apache.wicket.util.instrument
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 an Objects.IObjectSizeOfStrategy
at
Objects.setObjectSizeOfStrategy(IObjectSizeOfStrategy)
. Note that this is a static
registration.
- Author:
- eelcohillenius
Method Summary |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObjectSizeOfAgent
public ObjectSizeOfAgent()
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
Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.