5 Replies Latest reply on Aug 12, 2009 10:41 AM by jesper.pedersen

    JVMTI committed on Branch_2_0

    clebert.suconic

      I just committed JVMTIInterface on JBossProfiler2.

      One of the good things on JBoss profiler 1 was the JVMTI module, that can be automated through JNI. There are a few tests using it on JBoss AS, and I think this is perfectly aligned with JBoss Profiler 2.

      Jason was looking for a replacement of the JVMTI for a final version on JBAS, so I think this would be a good solution.

      I've also added a few features around memory profiler.

      I had a few leaks to chase on JBoss Messaging 2, and the best way to find them was by creating a few reports instead of spending a lot of time on tinkering with JVMTI Interface.

      It is possible now to call a method startMemoryProfiler(InetAddress). That
      method will start a small embedded Web Server (available on JDK 1.6+), and you would be able to link on references through the JVM (All live).

      I've kept the build using Cmake. It should be fairly simple to compile it.

      Also, the current code already has some support for inspecting methods. It's crashing but it's an initial version already.

        • 1. Re: JVMTI committed on Branch_2_0
          clebert.suconic

          There is a test called org.jboss.profiler.test.jvmti.JVMTIWebTestManual


          I don't have an ant target for it yet. But if you run it through eclipse, you would be able to see the simple web interface.


          You have to add those two parameters on the JDK:

          -Djava.library.path=/work/projects/prof2/src/native/ -agentpath:/work/projects/prof2/src/native/libJBossProfiler.so



          Or define LD_LIBRARY_PATH, and only add one:

          -agentlib:JBossProfiler

          • 2. Re: JVMTI committed on Branch_2_0
            clebert.suconic

             

            Also, the current code already has some support for inspecting methods. It's crashing but it's an initial version already.



            I meant native profiling by this.

            • 3. Re: JVMTI committed on Branch_2_0
              jesper.pedersen

              Thanks, Clebert.

              I'll take a look and report back ASAP.

              A couple of things though:

              1) You broke the JDK 1.5 build - you need to make the compile of JVMTI depend on JDK 1.6

              2) The source code has to be formatted according to the project rules, run

              ant checkstyle
              


              and fix the reported problems. The style guide is part of the developer documentation.

              • 4. Re: JVMTI committed on Branch_2_0
                clebert.suconic

                I will fix the dependency later tonight...


                Regarding the style... all the other projects at JBoss use next line on brackets.

                I know I have used next line on 1.0, but I think we should do the same as other projects.


                I committed a style settings on eclipse. If you use eclipse (which I believe you do), it would format the same for everybody. We should agree on a format and change that settings, then the format fix is automatic.

                • 5. Re: JVMTI committed on Branch_2_0
                  jesper.pedersen

                   


                  I will fix the dependency later tonight...

                  Thanks,


                  Regarding the style...


                  Yes, I know that the style is different from other JBoss projects, but that was the style of the original code submission. Checkstyle will though force it to be the same all-over.

                  If you want the task of doing a code reformat I have settings for a JBoss code style - but I think we should the little time we have on other things.