eap build 524 - How do I enable JVMTI?

Questions about YourKit Java Profiler
Post Reply
drabe
Posts: 4
Joined: Mon Feb 07, 2005 8:50 pm

eap build 524 - How do I enable JVMTI?

Post by drabe »

When I run, I get the message:
[YourKit Java Profiler 4.0 EAP build 524] Using JVMPI
[YourKit Java Profiler 4.0 EAP build 524] *** HINT ***: we recommend using Java 5.0 and JVMTI when possible!
[YourKit Java Profiler 4.0 EAP build 524] Listening on port 1229...

I installed (and believe I am using) JDK 1.5.0_01. My app writes out some info about its environment:
Java Version: 1.5.0_01, Sun Microsystems Inc.
Java VM: Java HotSpot(TM) Server VM, mixed mode
Java Max Heap Size: 530907136
Java Home: C:\Program Files\Java\jdk1.5.0_01\jre

How can I force it to use JVMTI?
Thanks.
Sascha Weinreuter
Posts: 46
Joined: Mon Jan 24, 2005 3:01 pm

Post by Sascha Weinreuter »

Here's what I found in the help files (%yp-home%/docs/agent.htm). Seems you have to use a different JVM parameter to specify the profiler agent to use.
Step 2: add appropriate VM parameter to the command line of Java application

The parameter depends on Java version.

To use Java 1.3 or 1.4 with JVMPI API, use -Xrunyjpagent parameter

E.g.: java -Xrunyjpagent FooClass

To use Java 5.0 or higher with JVMTI API, use -agentlib:yjpagent parameter

E.g.: java -agentlib:yjpagent FooClass

Java 5.0 note: Java 5.0 supports both deprecated JVMPI API and new JVMTI API. It is desired to use JVMTI when possible. Java 5.0 supports both -agentlib:yjpagent (uses new JVMTI API) and -Xrunyjpagent (uses deprecated JVMPI) parameters. Please make sure -agentlib:yjpagent is specified.
BTW: I think I haven't seen a switch for that in the IDEA integration. Is this only shown (or default) when using JDK 5 or has this to be configured manually?

Sascha
drabe
Posts: 4
Joined: Mon Feb 07, 2005 8:50 pm

Post by drabe »

Thanks, that was it!

I noticed that method tracing seems to be much slower with JVMTI than with JVMPI. Has anybody else noticed that? Is it expected?

--Dan
Post Reply