MemoryMeter : Instrumentation is not set; Jamm must be set as -javaagent

254 Views Asked by At

After cloning jamm and setting the maven URL in the build.xml to https://repo1.maven.org/maven2/org/apache/ivy/ivy, I was able to install it with ant jar. Now I'm trying to use MemoryMeter in my project code.

The official GitHub README says: 'To use MemoryMeter, start the JVM with "-javaagent:/jamm.jar"'.

Following this advice and using a javaagent for the first time in my life (in a Grails 2.5.6 project) I've set the following in my IDEA IntelliJ run configuration:

  • in VM options: -javaagent:"/home/myusername/git/laser-ygor/lib/jamm-0.3.4-SNAPSHOT.jar"
  • in Command line: -noreloading -javaagent:"/home/myusername/git/laser-ygor/lib/jamm-0.3.4-SNAPSHOT.jar" run-app

I think one of those two javaagent settings should be obsolete, but I don't know which of them works, and I believe it won't do any harm to set them both.

Anyway, I'm experiencing: Instrumentation is not set; Jamm must be set as -javaagent.

which obviously is caused by instrumentation being null.

So, how can I use this javaagent with instrumentation being not null?

0

There are 0 best solutions below