I am trying to print the memory usage of an collection through java instrumentation api. Gone through the instrumentation api's in java. Can anyone please tell me how to configure it in KARAF container.
Tried by adding the below entry in classpath KARAF_JVM_OPTS="$KARAF_JVM_OPTS -javaagent:/var/tmp/java-agent-1.0.0.jar" Also added in properties file org.osgi.framework.bootdelegation=com.test.java.javaagent.*
Adding JAVA_OPTIONS to Karaf depends on how you start Karaf.
Basically, you have 3 ways:
Note : You have to add the argument
-javaagent:<<PATH_OF_YOUR_JAR>>only on the JAVA_OPTIONS , not on the classpath.