JVMTI and JVMPI?

Questions about YourKit Java Profiler
Post Reply
vsonnathi
Posts: 8
Joined: Thu Jan 13, 2005 5:04 pm

JVMTI and JVMPI?

Post by vsonnathi »

Hi,

Is there any way you can turn on JVMTI with Java 5.0? I am running my app with Java 5.0 and here's the status I get

Command line: "C:\jdk1.5.0_03\bin\java" -Xrunyjpagent:sessionname=YJPQUOTED636f6e74616374732d66696c74657220286c61756e636865642066726f6d204944454129,profileruipath=YJPQUOTED433a5c50726f6772616d2046696c65735c596f75724b6974204a6176612050726f66696c657220342e3520454150206275696c64203630365c62696e5c796a702e657865,ideport=4656 -DTEMP_STAGE_FOLDER=d:\build\gold\GOLD-src\GOLD-src\temp -DTEMP_STAGE_URL=http://ws6048.ggtest.com:8080/src/test -Djava.endorsed.dirs="C:\tomcat-5.0.27\common\endorsed" -classpath "C:\jdk1.5.0_03\lib\tools.jar;C:\tomcat-5.0.27\bin\bootstrap.jar" -Dcatalina.base="D:\IntelliJ-IRIDA\system\tomcat_contacts-filter_7195e240" -Dcatalina.home="C:\tomcat-5.0.27" -Djava.io.tmpdir="C:\src\tomcat-gold\temp" org.apache.catalina.startup.Bootstrap start
[YourKit Java Profiler 4.5 EAP build 606] Using JVMPI
[YourKit Java Profiler 4.5 EAP build 606] *** HINT ***: we recommend using Java 5.0 and JVMTI when possible!
[YourKit Java Profiler 4.5 EAP build 606] Listening on port 1323...

Probably this is a very basic question.

Thanks,
--Venkat.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

Hello,

Could you please take a look how JDK is configured in IDEA? In particular, how is it named in the list of JDKs?

Best regards,
Anton
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

P.S:

JVMTI is used automatically when application is launched from IDE with Java 5.0 or higher. In IntelliJ IDEA, the check is made via IDEA's API call ProjectJDK.getVersionString()

So one of the ideas is that in your case theAPI call returns improper value.

What IDEA version/build do you use?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

Could you please as well post <IDEA settings>/config/options/jdk.table.xml
vsonnathi
Posts: 8
Joined: Thu Jan 13, 2005 5:04 pm

Post by vsonnathi »

Hi Anton,

I am using IDEA Irida #3341 build.

Here is the jdk.table.xml:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<application>
  <component name="ProjectJdkTable">
    <jdk version="2">
      <name value="Default" />
      <type value="JavaSDK" />
      <version value="java version "1.4.2"" />
      <homePath value="C:/j2sdk1.4.2" />
      <roots>
        <sourcePath>
          <root type="composite">
            <root type="simple" url="jar://C:/j2sdk1.4.2/src.zip!/" />
          </root>
        </sourcePath>
        <classPath>
          <root type="composite">
            <root type="simple" url="jar://C:/j2sdk1.4.2/jre/lib/charsets.jar!/" />
            <root type="simple" url="jar://C:/j2sdk1.4.2/jre/lib/jce.jar!/" />
            <root type="simple" url="jar://C:/j2sdk1.4.2/jre/lib/jsse.jar!/" />
            <root type="simple" url="jar://C:/j2sdk1.4.2/jre/lib/plugin.jar!/" />
            <root type="simple" url="jar://C:/j2sdk1.4.2/jre/lib/rt.jar!/" />
            <root type="simple" url="jar://C:/j2sdk1.4.2/jre/lib/sunrsasign.jar!/" />
            <root type="simple" url="jar://C:/j2sdk1.4.2/jre/lib/ext/dnsns.jar!/" />
            <root type="simple" url="jar://C:/j2sdk1.4.2/jre/lib/ext/ldapsec.jar!/" />
            <root type="simple" url="jar://C:/j2sdk1.4.2/jre/lib/ext/localedata.jar!/" />
            <root type="simple" url="jar://C:/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar!/" />
          </root>
        </classPath>
        <javadocPath>
          <root type="composite" />
        </javadocPath>
      </roots>
      <additional />
    </jdk>
    <jdk version="2">
      <name value="Default 1.5" />
      <type value="JavaSDK" />
      <version value="java version "1.5.0_03"" />
      <homePath value="C:/jdk1.5.0_03" />
      <roots>
        <sourcePath>
          <root type="composite">
            <root type="simple" url="jar://C:/jdk1.5.0_03/src.zip!/" />
          </root>
        </sourcePath>
        <classPath>
          <root type="composite">
            <root type="simple" url="jar://C:/jdk1.5.0_03/jre/lib/charsets.jar!/" />
            <root type="simple" url="jar://C:/jdk1.5.0_03/jre/lib/deploy.jar!/" />
            <root type="simple" url="jar://C:/jdk1.5.0_03/jre/lib/javaws.jar!/" />
            <root type="simple" url="jar://C:/jdk1.5.0_03/jre/lib/jce.jar!/" />
            <root type="simple" url="jar://C:/jdk1.5.0_03/jre/lib/jsse.jar!/" />
            <root type="simple" url="jar://C:/jdk1.5.0_03/jre/lib/plugin.jar!/" />
            <root type="simple" url="jar://C:/jdk1.5.0_03/jre/lib/rt.jar!/" />
            <root type="simple" url="jar://C:/jdk1.5.0_03/jre/lib/ext/dnsns.jar!/" />
            <root type="simple" url="jar://C:/jdk1.5.0_03/jre/lib/ext/localedata.jar!/" />
            <root type="simple" url="jar://C:/jdk1.5.0_03/jre/lib/ext/sunjce_provider.jar!/" />
            <root type="simple" url="jar://C:/jdk1.5.0_03/jre/lib/ext/sunpkcs11.jar!/" />
          </root>
        </classPath>
        <javadocPath>
          <root type="composite" />
        </javadocPath>
      </roots>
      <additional />
    </jdk>
  </component>
</application>

Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

Thank you for the xml.

Everything seems OK with it.

Could you please provide more detail, and step by step instructions how to reproduce what you are doing.

Do you launch your application with Profile action?

What run configuration type is this?
vsonnathi
Posts: 8
Joined: Thu Jan 13, 2005 5:04 pm

Post by vsonnathi »

Hi Anton,

I am trying to profile a tomcat (5.0.27) web application with JDK 1.5.0_03. I am also running IDEA with the same JDK. I lauch the application with the Profile Action.

I see the same message in the IDEA console window as well:
[YourKit Java Profiler 4.0.11] Using JVMPI
[YourKit Java Profiler 4.0.11] *** HINT ***: we recommend using Java 5.0 and JVM
TI when possible!
[YourKit Java Profiler 4.0.11] Listening on port 10100...
Execute delete[c:\intellij\config\plugins\unitTest]

I think there is a bug with IDEA ProjectJDK.getVersionString() which you are trying to access.

Let me know if you need more info.

Thanks,
--Venkat.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

I can see one time you used YourKit Java Profiler 4.0.11, and another time 4.5 EAP.

Which build are you actually using? It's to know important because getVersionString() is used in 4.5, in 4.0 a different approach is used.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

Could you please as well:

1. Make sure you are using YourKit Java Profiler 4.5 EAP (run integrate with IDE action, re-start IDEA...)

2. Delete JDK definition in IDEA

3. Add JDK again
vsonnathi
Posts: 8
Joined: Thu Jan 13, 2005 5:04 pm

Post by vsonnathi »

Hi Anton,

The second output was from IDEA's console window which by bundles YourKit 4.0.11 for its memory and cpu snapshot capabilities.

I am using 4.5 EAP to profile my application running inside IDEA (IRIDA).

I tried the sequence you described and here's the output:

Using JAVA_HOME: C:\jdk1.5.0_03
Command line: "C:\jdk1.5.0_03\bin\java" -Xrunyjpagent:sessionname=YJPQUOTED636f6e74616374732d66696c74657220286c61756e636865642066726f6d204944454129 -DTEMP_STAGE_FOLDER=d:\build\gold\GOLD-src\GOLD-src\temp -DTEMP_STAGE_URL=http://ws6048.ggtest.com:8080/src/test -Djava.endorsed.dirs="C:\tomcat-5.0.27\common\endorsed" -classpath "C:\jdk1.5.0_03\lib\tools.jar;C:\tomcat-5.0.27\bin\bootstrap.jar" -Dcatalina.base="D:\IntelliJ-IRIDA\system\tomcat_contacts-filter_7195e240" -Dcatalina.home="C:\tomcat-5.0.27" -Djava.io.tmpdir="C:\src\tomcat-gold\temp" org.apache.catalina.startup.Bootstrap start
[YourKit Java Profiler 4.5 EAP build 606] Using JVMPI
[YourKit Java Profiler 4.5 EAP build 606] *** HINT ***: we recommend using Java 5.0 and JVMTI when possible!
[YourKit Java Profiler 4.5 EAP build 606] Listening on port 2250...

It is still using JVMPI.

Thanks,
--Venkat.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

In about an hour there will be next build 608 published.

Could you please use its plugin then.

Each time you use Profile action, the plugin will print into IDEA's console (I mean console of IDEA itself, not console shown in IDEA) debug messages like:

yjp: jdk = ...
yjp: versionString = ...
yjp: useJVMTI = ...

Just curious what are the values in your case.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

FYI: the build is available for download.
vsonnathi
Posts: 8
Joined: Thu Jan 13, 2005 5:04 pm

Post by vsonnathi »

Hi,

Here's the output on the IDEA's console:

yjp: jdk = null
yjp: useJVMTI = false
yjp: jdk = null
yjp: useJVMTI = false
yjp: jdk = null
yjp: useJVMTI = false
vsonnathi
Posts: 8
Joined: Thu Jan 13, 2005 5:04 pm

Post by vsonnathi »

Hi,

My telemetry window is blank. Is that because of the above, it is not detecting JDK 1.5?

Thanks,
--Venkat.
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Post by Vladimir Kondratyev »

My telemetry window is blank. Is that because of the above, it is not detecting JDK 1.5?
It's known issue. Telemetty window should present only if JVMTI agent is detected. This inconsistency will be fixed in one of upcoming builds.

Regards,
Vladimir
Post Reply