1 Reply Latest reply: Oct 18, 2011 5:46 AM by 534035 RSS

    Connecting VisualVM to Oracle JVM

    534035
      Has anyone had any success connection to the database JVM using Visual VM.

      I've started the jmx agent using dbms_java.start_jmx_agent, and am able to connect with jconsole without problems, but when I try to connect with VisualVM, I get an error message java.lang.NumberFormatException: For input string: "(PID=5044;SID=248)"

      I've taken a look at the VisualVM code and the problem appears to be that when VisualVM reads the virtual machine name, it gets something like (PID=X;SID=Y)@SERVERNAME. Visual VM then takes everything before the @ in that name string and attempts to convert it to an integer.

      Versions:
      Oracle Database 11gR2 running on Windows.
      Oracle VisualVM 1.3.2

      For background, I'm trying to profile a Java procedure which is running much slower inside the DB than outside of it.

      A quick fix might be to 'rename' the java virtual machine for the database session in question, but I can't find a way to do that? Any ideas?

      Many thanks,

      James
        • 1. Re: Connecting VisualVM to Oracle JVM
          534035
          I never solved this. but did find a very crude workaround. Here it is in case anyone has a similar problem .

          The reason I needed visualVM was to profile some slow running code within the DB. The best I could do in the end was to use jconsole and repeatedly use the EmitStackTrace mbean option. Using this it is possible to build a picture of which methods the JVM is spending most of its time in.

          The problem by the way was that one method was not being compiled by the JIT compiler, so it was always being interpreted. Fortunately that method wasn't essential to the process and by avoiding it, performance improved to the same, (actually very slightly faster) than the standard JVM /JRE.

          James