Menu

Can Jensor profile a JBOSS application?

Help
2008-10-23
2013-05-13
  • Aha! Developer

    Aha! Developer - 2008-10-23

    I have a general setup/config question: Has anybody ever succeeded in running Jensor with JBOSS?  I am trying to get Jensor to profile a JBOSS application running on Linux (specifically Centos 4).  I am able to get Jensor to work in a scaled down subset of my environment (ie. be able to profile a very simple "hello world" Java app).  But one unexpected issue I found was that I could not get the Jensor-provided JAR files to be used, unless I expanded them into their directories/class files.  What do I need to do to make it work with JBOSS?  I am using JBOSS v4.2.1.

    Thanks alot.

     
    • Amol Khanapurkar

      Hi,

      Jensor can definitely monitor JBoss applications. The fact that instrumentation is done manually makes Jensor Application Server neutral. It can run on all App Servers, Client-side, middleware, and even in embedded systems( though I have not tried this out).

      To make Jensor work, in context of application servers, the following needs to happen.

      1) Jensor classes need to load before the application classes.
      2) Jenso classes need to be in application classpath.

      For JBoss specifically, put Jensor jar in JBoss classpath in startup script or put it in JBoss Server Lib (APP-LIB). All classes in APP-LIB are loaded before application is loaded. On say Windows, this will be %JBOSS_HOME%\server\default\lib (depending on your JBoss configuration).

      Apart from this you just need to ensure that JENSOR_HOME variable is set properly.

      Cheers,
      Amol

       
    • Aha! Developer

      Aha! Developer - 2008-10-24

      OK, thanks, I was able to get Jensor working with JBOSS now.  It has a relatively light-weight impact on the operations of my application.  What tools does Jensor currently have that can help me analyze memory issues?  I have a JBOSS application that seems to constantly grow over the course of many instantiations.  It is a fairly complex object tree/hierarchy and I would like to be able to pinpoint where the "leak" may be occurring.  I can get a count for the number of iterations, but that alone does not seem to be enough info.  I am also looking at the garbage collection function, though I do not predict alot of success from tuning that.  Thanks again for your help.

       
    • Amol Khanapurkar

      You can use Charts and Object Instantiation module to figure out more about memory consumption. This how

      Charts

      This module displays memory utilization and bottleneck methods with their response time. A slow and gradually leaking method will also eventually start taking more and more time and hence get bubbled up in response time histograms. This method code can then be studied manually for any leaks.

      Object Instantiations

      This module captures which method allocates which object and how many times. Due to limited interaction with garbage collector, Jensor (as of this writing) cannot figure out when a object is deallocated. Hence it cannot figure out which object is leaking. The information that this module provides can be used in following way to figure out leaks

      1) Narrow down to interval where memory increase is maximum. For this time interval you can find out which objects have got instantiated. This will give you an idea about which objects are bulky.

      2) For all methods which instantiates an object in global scope, figure out through other modules if methods which deallocate this object is called or not.

      3) In general, look for anti-patterns i.e. if there is a createConnection() call look for corresponding releaseConnection() call. It will help you get closer to the source of leaks.

      Finally, this version of Jensor can only provide "clues" but not reliably help in detecting leaks. Most decisions to figure out if an object is leaked still have to be taken manually.

      Hope you get enough clues.

      Regards,
      Amol

       

Log in to post a comment.