build #604: automatic launching of UI broken

Questions about YourKit Java Profiler
Post Reply
pepijnve
Posts: 21
Joined: Tue May 17, 2005 1:38 pm

build #604: automatic launching of UI broken

Post by pepijnve »

I am using the IDE integeration for IDEA 4.5.
When I launch my application using the profile button I get the following messages:
[YourKit Java Profiler 4.5 EAP build 604] Using JVMPI
[YourKit Java Profiler 4.5 EAP build 604] *** HINT ***: we recommend using Java 5.0 and JVMTI when possible!
[YourKit Java Profiler 4.5 EAP build 604] Listening on port 2990...
[YourKit Java Profiler 4.5 EAP build 604] [YourKit Java Profiler 4.5 EAP build 604] Launching profiler UI (D:\java\YourKit Java Profiler 4.5 EAP build 604\bin\yjp.exe)

The UI is indeed launched, but the launching seems to be stuck in a loop since it continues launching new instances of the UI indefinitely. If I let my application run for a couple of seconds I can see about 10-15 instances of javaw.exe in the task manager already :)
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

I can suppose why this could happen...

What is the exact build number of the IDEA?

What Java do you run IDEA with?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

And what is the exact version of Windows?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

Another question: do you have -Xrunyjpagent/-agentlib JVM parameters explicitly set for your application?
pepijnve
Posts: 21
Joined: Tue May 17, 2005 1:38 pm

Post by pepijnve »

1) Idea 4.5.4 build #2253
2) Windows NT 4 (4.00.1381), not sure which SP
3) I'm passing the following VM parameters explicitly: -Xms128m -Xmx256m -Xbootclasspath/p:d:/map/patch/bootpatch.jar
I'm starting the profiler using the 'Profile' button.
pepijnve
Posts: 21
Joined: Tue May 17, 2005 1:38 pm

Post by pepijnve »

1) Idea 4.5.4 build #2253
2) Windows NT 4 (4.00.1381), SP6a
3) I'm passing the following VM parameters explicitly: -Xms128m -Xmx256m -Xbootclasspath/p:d:/map/patch/bootpatch.jar
I'm starting the profiler using the 'Profile' button.
pepijnve
Posts: 21
Joined: Tue May 17, 2005 1:38 pm

Post by pepijnve »

Idea is running under the bundled JRE (1.4.2_04)
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

The problem is with JAVA_TOOL_OPTIONS environment variable, that we were using for automatic choice in runtime of JVMTI (-agentlib specified via JAVA_TOOL_OPTIONS) vs. JVMPI (-Xrun in command line) profiling API, based on actual running JVM.

If this variable is inherited by called Java, it makes it run with profiler. This was the case with the profiler UI, which was itself started with profiler agent, which was instructed to launch yjp.exe etc..

To work this around, yjp.exe clears JAVA_TOOL_OPTIONS environment variable before running "java -jar yjp.jar"

For some reason this approach does not work on Windows NT.

Anyway, the next build 606 will have this area totally reworked. We'll get rid of JAVA_TOOL_OPTIONS usage when profiling from IDE, detecting Java version using IDE's API and explicitly specifing -agentlib or -Xrun in command line of profiled application.
Post Reply