VisualVM in IcedTea

VisualVM, the lightweight profiler and troubleshooting tool is now available to build as part of IcedTea6 for 32 and 64 bit arch :). The whole thing builds from source — NetBeans platform7 and profiler2 (visualvm_preview2), and finally VisualVM 1.0. A binary launcher `jvisualvm` is put in the ${JDK}/bin directory along with the rest of the tools.

Screenshots:

To get building, you’ll need to pass –enable-visualvm to ./configure. Subsequent builds should take advantage of –with-visualvm-src-zip, –with-netbeans-platform-src-zip, and –with-netbeans-profiler-src-zip options, to prevent re-downloading of the NetBeans and VisualVM sources. Once the zips/tarballs are downloaded for the first time, my VisualVM options passed to ./configure typically looks like this:

./configure ... --enable-visualvm --with-visualvm-src-zip=visualvm-20080728-src.tar.gz --with-netbeans-platform-src-zip=netbeans-6.0.1-200801291616-platform-src.zip --with-netbeans-profiler-src-zip=netbeans-profiler-visualvm_preview2.tar.gz

Also, you’ll probably need the ant-nodeps package installed for some bootstrapping when building.

Hopefully in the near future we’ll be able to see some of VisualVM in Fedora once NetBeans platform is packaged πŸ™‚

EDIT: You do not need to build OpenJDK to /build/ VisualVM on it’s own. To just build VisualVM, you will need either an existing OpenJDK (like your system one, enabled with –with-openjdk in configure), or an IcedTea-ecj build. After that, typing `make visualvm` will build visualvm, but will not be *nicely* usable until you build IcedTea. VisualVM will only work nicely when dropped into a JDK-style directory, and this is done after IcedTea is built (dropping the visualvm build into j2sdk-image).

7 Responses to VisualVM in IcedTea

  1. […] 29, 2008 Yey! Josh did it […]

  2. Just occurred to me; how will visualvm interact with zero/shark/cacao? At what level does it interact with the VM?

  3. @Andrew

    I’m not too sure, actually. I don’t know how VisualVM is implemented, but I do know there’s a bit of JFluid native stuff that’s required. (netbeans/profiler/libs/jfluid/native).

    I’m kinda curious now myself πŸ™‚

  4. @Andrew

    VisualVM will use whatever data channel is available on the target JVM. We can utilize jvmstat, JMX and SA-agent info out of the box. For profiling JVMTI is used (at the time it relies on some perks in Sun’s JVM but it means only no guaranteed profiling on other JVMs).
    From the architectural point of view the VisualVM is extensible also in the way how to get the interesting data – it’s possible to write new data sources utilizing some specific features of other JVMs (eg. IBM’s one). Plz, refer to VisualVM API documentation for more details.

    And last but not least great kudos to Josh from VisualVM team for getting the VisualVM into IcedTea!

  5. Eugene Gordienko says:

    I try to build:
    icedtea6]# PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LLVM_CONFIG=$(dirname $PWD)/llvm/Release/bin/llvm-config ./configure –enable-sharkPKG_CONFIG_PATH=/usr/local/lib/pkgconfig LLVM_CONFIG=$(dirname $PWD)/llvm/Debug/bin/llvm-config; ./configure –enable-shark –enable-visualvm –with-visualvm-src-zip=/opt/build-icedtea/netbeans-src/visualvm-20080728-src.tar.gz –with-netbeans-platform-src-zip=/opt/build-icedtea/netbeans-src/netbeans-6.0.1-200801291616-platform-src.zip –with-netbeans-profiler-src-zip=/opt/build-icedtea/netbeans-src/netbeans-profiler-visualvm_preview2.tar.gz

    I have sources in /opt/build-icedtea/netbeans-src/ but I get:
    checking whether to build VisualVM… checking for netbeans… no
    configure: error: “NetBeans was not found.”

    Any ideas why?
    Many thanks in advance…
    Eugene

  6. lillian says:

    The netbeans platform must be installed to build visualvm. We no longer build netbeans before building visualvm, since it is now included in some distributions (i.e. Fedora)

  7. Eugene Gordienko says:

    And I have netbeans in /usr/share, can run it with ibm jvm.
    But when I try it:
    PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure –with-netbeans-home=/usr/share/netbeans –enable-visualvm –with-visualvm-src-zip=/opt/build-icedtea/netbeans-src/visualvm-20080728-src.tar.gz –with-netbeans-platform-src-zip=/opt/build-icedtea/netbeans-src/netbeans-6.0.1-200801291616-platform-src.zip –with-netbeans-profiler-src-zip=/opt/build-icedtea/netbeans-src/netbeans-profiler-visualvm_preview2.tar.gz

    I get:
    checking whether to build VisualVM… checking for netbeans… no
    configure: error: “NetBeans was not found.”

Leave a reply to Eugene Gordienko Cancel reply