Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2011-08-10T13:24:59Z by MarkFrost
MarkFrost
MarkFrost
2 Posts
ACCEPTED ANSWER

Pinned topic How to use Purify on native library loaded by JVM on Windows?

‏2011-08-09T15:46:24Z |
I have native libraries (C) that I'd like to investigate with Purify, while the libraries are being used by a Java test program that exercises them via JNI.

I'm having no success at all with this - searching on the web suggests that I need to run java.exe as the executable, which will cause the native libraries to be instrumented as they're loaded. However on Windows with either a Java 5 or a Java 6 JVM I just get a variety of errors. Is this actually supported, and if so what's the right way to get useful output from Purify?

Environment:
OS : Windows Server 2003 SP2
JVM : IBM Java5 SR12 FP5 or IBM Java6 SR8 FP1
Purify : 7.0.1.0-001 Build 11785


With a Java5 JVM, running from the GUI for "error and leak data":

Program name: C:\Program Files\IBM\Java50\jre\bin\java.exe
Commandline args: -version

I get the error:
Failed to find VM - aborting



With a Java6 JVM, running from the GUI for "error and leak data":

Program name: C:\Program Files\IBM\Java60\jre\bin\java.exe
Commandline args: -version

I get the error:
Error loading: C:\Program Files\IBM\Java60\jre\bin\j9vm\jvm.dll
Updated on 2011-08-10T13:24:59Z at 2011-08-10T13:24:59Z by MarkFrost
  • SystemAdmin
    SystemAdmin
    2948 Posts
    ACCEPTED ANSWER

    Re: How to use Purify on native library loaded by JVM on Windows?

    ‏2011-08-09T17:11:21Z  in response to MarkFrost
    Hi MarkFrost,

    >
    > I get the error:
    > Failed to find VM - aborting
    >

    It is very important to add the appropriate Java folders in your PATH environment
    variable so that Purify can find all the proper java.exe dependencies, such as
    jvm.dll, etc. Two directories that you most likely will need are the \jre\bin and
    \jre\bin\hotspot (or classic). For more info, please see:

    https://www-304.ibm.com/support/docview.wss?uid=swg21123440

    Also, you may want to contact Tech Support (1-800-IBM-SERV) to see if they have
    any additional tips. For example, using Purify's Selective Instrumentation option
    might be a viable option.

    Best regards,
    Don
    • MarkFrost
      MarkFrost
      2 Posts
      ACCEPTED ANSWER

      Re: How to use Purify on native library loaded by JVM on Windows?

      ‏2011-08-10T13:24:59Z  in response to SystemAdmin
      Hi Don,

      Thanks for you quick reply ... but I'm not having any more success. I've ensured the Windows system variable PATH includes: C:\Program Files\IBM\Java50\jre\bin;C:\Program Files\IBM\Java50\jre\bin\j9vm;...

      Altered the JVM security as described in your link above, rebooted, cleared the Purify cache, tried similarly with both Java5 and Java6 JVMs and I still get the same errors as the original post for 'java.exe -version' under Purify.

      Does anyone have any further ideas?