Search code examples
eclipseprofilingeclipse-luna

How to profile a Java web application servlet call in Eclipse EE Luna


In my web application a servlet needs multiple seconds even before it starts to write the response. I would like to find out, which methods are called during servlet execution and what time each method takes.

Is there a profiler already included in the Luna release of Eclipse IDE for Java EE Developers? How do I activate it?

There is a lot information available on the web, but it seams names change all the time so I have difficulties to filter the relevant.


Solution

  • JVM Monitor 3.8 works fine with Eclipse Luna and it is also quite simple to use.

    1. download and install from eclipse marketplace
    2. restart eclipse
    3. start your application
    4. open JVM Explorer view via window > show view [> other ]> Java Monitor > JVM Explorer
    5. find your app server process, right click on it and pick Start Monitoring
    6. you should now land in the Properties view and see graphs with cpu and memory usage
    7. select the CPU tab
    8. click on select profiled CPU packages (you can always change them with right click > properties)
    9. in the top right corner of the Properties tab click on Start CPU Profiling (or it may be called Resume CPU Profiling)

    Now your call tree should be populated as you interact with your application and you can analyse the method calls and their duration. The output should look like this:

    Profiler example output