djechlin
djechlin

Reputation: 60748

jrat - java profiling fails

I run:

~/dan/java/hello $ java -javaagent:shiftone-jrat.jar -cp '..' hello.hello

and get (within longer trace output):

Exception in thread "main" java.lang.VerifyError: Expecting a stackmap frame at branch target 35 in method hello.hello.main([Ljava/lang/String;)V at offset 14
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
    at java.lang.Class.getMethod0(Class.java:2685)
    at java.lang.Class.getMethod(Class.java:1620)
    at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:488)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:480)

Went with jrat because it seemed turnkey. I'm open to suggestions for other turn-key, command-line Linux-compatible profilers. Just need to know very simple info i.e. what functions my program is spending most of its time in, in the meantime I'll poke around with other profilers suggested here and there add lots of print statements until I realize my regexes are fine and my stream -> string conversion is taking forever.

Upvotes: 1

Views: 509

Answers (1)

JB-
JB-

Reputation: 2670

Are you using JDK6 or JDK7. JDK7 added more restrictive checks for stackmap frames and they can result in such errors when the bytecode is modified by tools unaware of the changes in JDK7 verifier (older versions of ASM eg.)

Upvotes: 1

Related Questions