Netbeans 5.5 Profiler with Coldfusion 7.02

I am in the position of needing to check out what is going on in the memory of the JVM instance running a particular process.  I need to see if it’s being release properly (no memory leaks), and get an idea of when the process will top out (how many requests).  So, I tried out FusionReactor, and that gave me a decent picture of things (http://www.fusion-reactor.com).  And I decided to give JFluid a whirl.

There are lots of good blogs, and pages by Sun on this, so have a look around, if you are planning to set this up.  Here are a couple of links that were helpful to me:

I had some difficulty before getting JFluid to run (links later) and didn’t have a pressing need.  But now I really wanted to have a good look.  And when I did look, I found that JFluid had been “promoted” – the once experimental package had been packaged for NetBeans, the old pages for JFluid forwarding to the new pages.  The package is now officially known as NetBeans Profiler (http://profiler.netbeans.org/index.html)  It supports JVM 1.42, which is what we are running CF 7.02 on, so it will work well.  It also supports JVM 1.41, 1.5, but each flavor with a different manner of support.  In addition to the JVM version support having nuanced differences, the Netbeans platforms each have their own specific packages (Netbeans 4.1, 5.0, 5.5, 5.51  ).

I run Netbeans 5.5 right now, so that’s what I got, in three downloads, the three parts to the package.  One part is a modified jvm.dll for JVM 1.42 (Windoze) or .so for Unix platforms, amidst caveats that Sun does not support the 1.42 build, that it is presented “as is.”   Another part is the profileattach.dll’s  (or .so) for attaching the profiler to the jvm.  And lastly there is the runtime.  Read Sun’s page carefully, as it’s easy to miss something.

I did not get dynamic attachment working, but rather, Direct Attachment, which is actually better for what I am doing.  I have to launch the Coldfusion server from the command line, but I see the system out messages.  Netbeans has “wizard” for setting up the profiling, which presents these options.

At the end I had these instructions: 

Step 1. Add the profiler native libraries to the Path, e.g. using  

SET Path=C:Program Filesnetbeans-5.5profiler1libdeployedjdk142windows;%Path%  

Step 2. Setup the server to run on modified Profiler 1.4.2 JDK, which can be found in  

C:Documents and Settingshoward.netbeans5.5modulesprofiler-ea-vm  

This typically means changing system/environment variable JAVA_HOME as follows:  

SET JAVA_HOME=C:Documents and Settingshoward.netbeans5.5modulesprofiler-ea-vm  

Step 3. When starting the server, provide extra startup option to the java command:  

-Xrunprofilerinterface:"\"C:Program Filesnetbeans-5.5profiler1lib\"",5140  

Step 4. The JVM will start, but will not proceed with server execution until you connect the profiler to it.

JRun will not take the long paths and spaces in the directory names, so some conversion is necessary. Typically, I install all the Java stuff in the root in a folder called java, so I can avoid long filenames and so on, but Netbeans slipped through the cracks. So, my modified jvm.config looked like :

java.home=C:/DOCUME~1/howard/NETBEA~1/5.5/modules/PROFIL~1 
# If no java.home is specified a VM is located by looking in these places in this 
# order: 
# 
#  1) bin directory for java.dll (windows) or lib//libjava.so (unix) 
#  2) ../jre 
#  3) registry (windows only) 
#  4) JAVA_HOME env var plus jre (ie $JAVA_HOME/jre) 
# 
# Arguments to VM 
java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=128m -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS  -Dcoldfusion.rootDir={application.home}/ -Xrunprofilerinterface:C:/PROGRA~1/NETBEA~1.5/PROFIL~1/lib,5140 
#  -XX:+UseParallelGC 
# commas will be converted to platform specific separator and the result will be passed 
# as -Djava.ext.dirs= to the VM 
java.ext.dirs={jre.home}/lib/ext 
# 
# where to find shared libraries 
java.library.path=C:/DOCUME~1/howard/NETBEA~1/5.5/modules/PROFIL~1/lib,C:/DOCUME~1/howard/NETBEA~1/5.5/modules/PROFIL~1/jre/lib,{application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib,{application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/jintegra/bin,{application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/jintegra/bin/international 
system.path.first=false 
# 
# set the current working directory - useful for Windows to control 
# the default search path used when loading DLLs since it comes 
# before system directory, windows directory and PATH 
java.user.dir={application.home}/../lib 
# JVM classpath 
java.class.path={application.home}/servers/lib,{application.home}/servers/lib,{application.home}/lib

Note: I had to remove the -XX:UseParallelGC setting before it would run. Once these changes have been made, I can launch the CF Server with “jrun -start cfusion” and it will pause, waiting for the profiler to attach. In netbeans, I attach the profiler, and I start seeing info.

Netbeans Profiler Screenshot

Sure looks pretty, but it doesn’t do much for me unless I can interpret the data, and explain what it means.  So, the first step is getting some baseline measures on processing and proceed from there. (continued)

Netbeans Profiler Screenshot

Advertisements

One Response to Netbeans 5.5 Profiler with Coldfusion 7.02

  1. howardscholz says:

    It was interesting to see that the Profiler was eating up as much memory as the Coldfusion server running it’s processes. In fact, the Netbeans profiler had way to much detail for what I was needing to do. I did see some interesting things, thought, and it would be very helpful for debugging particular issues, issues with classLoaders and such. The fusion reactor monitoring product, and a few active scripts give me a more appropriate test bed.

    Howard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: