r4 - 30 Nov 2005 - 13:37:28 - BastiaanGruttersYou are here: TWiki >  Developers Web > ProfilingHowto

ProfilingHowto

Opensource profilers

In order to get a reasonable performance we are trying out some profilers to see whether we can increase the performance of our web-services. Escpecially th report methods are very memory and cpu intensive and need some tuning.
For a list of open profilers see this site. We've tried the following:

JRat

JRat shows a tree view of the methods called and lists their percentage of cpu usage and total time.

Installation

  • see the following guide for general instructions and this page for tomcat specific instructions.
  • The jrat jar goes into the tomcat/common/lib dir

Usage

  • Compile the webservices in eclipse and close eclipse afterwards to make sure it doesn't interfere.
  • Open Jrat:
     java -jar shiftone-jrat.jar
  • Select the classes directory to be injected
  • Go to the tomcat dir and set the environment variable:
    export JAVA_OPTS=-Djrat.factory=org.shiftone.jrat.provider.tree.TreeMethodHandlerFactory
  • Start tomcat using the startup.sh script and call the method you're interested in for profiling from your client
  • Shutdown tomcat using the shutdown.sh script
  • Open the outputfile in JRat. The file is located in the tomcat dir.

jmemprof

Jmemprof shows memory usage information per class/method.

Installation

Usage

  • To use jmemprof to profile set JAVA_OPTS to call jmemprof:
    export JAVA_OPTS=-Xrunjmempro
    and start tomcat from that terminal.
  • You can use the filter input field in the servlet so that only classes/methods from your packages are shown.

Eclipse profiler plugin

This plugin provides a lot of information integrated with our favourite ide.

Installation

  • The latest version of the plugin is sadly not usable with eclipse 3.1 but someone was so kind as to patch it. The patched version is available here
  • unpack the zip into your eclipse/plugins folder.
    • For windows: copy the ProfilerDll.dll file to your jre's bin folder.
    • For linux go into the native folder, unpack the profiler_linux.tgz tarball and copy the libProfilerDLL.so to your jre's lib folder.

Usage

also see their homepage
  • To use this plugin with a standalone application select run..., new profiler and add a vm-argument: -noverify

References:

JMP

A memory profiler, not yet tried this one. see http://www.khelekore.org/jmp/

-- IvoVanDongen - 29 Nov 2005

Extensible Java Profiler

This profiler is pretty easy to use, the result vieweris it's biggest drawback. The project page can be found here.

Installation

Follow the instructions from the included "instrumenting.txt", they worked for me under win2k.

Usage

Run your application with the added argument to the JVM: "-Xruntracer". Further information can be found in the "instrumenting.txt" file.

After running your application start the viewer and open the logged file, you can select a number of view filters, "Remove non-significant" is pretty usefull, it will hide all items, which didn't take much time.

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r4 < r3 < r2 < r1 | More topic actions

tip TWiki Tip of the Day
Disabling links in large blocks of text
You can disable automatic linking of WikiWords by surrounding the text with noautolink and /noautolink ... Read on Read more

 
OPS Homepage
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback