public portal of www.segersconsulting.com

JBoss profiling in 10 minutes

 

Download JBoss profiler

 Download the JBoss profiling 2.0 package from this location: http://www.jboss.org/jbossprofiler/

 At the time of this writing, latest version was 2.0 Beta3.SP1.zip for Windows & 2.0 Beta3.SP1.tar.gz for Unix  

Unzip JBoss Profiler

 Unpack the distribution in a folder on your file system.

This folder will be referred to as <PROFILING_DIR>

Install JBoss Profiler

 References

 <JBOSS_INSTALL_DIR>JBoss installation directory (e.g. C:\jboss-5.0.1.GA)

<CONF>server profile (this is “default” by default)

 Installation instructions 

  • Copy <PROFILING_DIR>/jboss-profiler.jar to <JBOSS_INSTALL_DIR>/bin
  • Copy <PROFILING_DIR>/jboss-profiler.properties to <JBOSS_INSTALL_DIR>/bin
  • Edit jboss-profiler.properties in <JBOSS_INSTALL_DIR>/bin to include the classes to be profiled: 

Example: We want to profile all classes in packages starting with be.hdp and org.skillteam 

includes=be.hdp.*,com.skillteam.* 

  • Copy <PROFILING_DIR>/jboss-profiler-plugins.jar to <JBOSS_INSTALL_DIR>/bin
  • Edit run.conf (Unix) or run.bat (Windows) in <JBOSS_INSTALL_DIR>/bin to include JBoss Profiler in JAVA_OPTS 

For windows add this line: 

set JAVA_OPTS=%JAVA_OPTS% -javaagent:jboss-profiler.jar -Djboss-profiler.properties=jboss-profiler.properties 

For Unix, add this line: 

JAVA_OPTS=”$JAVA_OPTS -javaagent:jboss-profiler.jar -Djboss-profiler.properties=jboss-profiler.properties” 

  • Copy <PROFILING_DIR>/jboss-profiler.sar to <JBOSS_INSTALL_DIR>/server/<conf>/deploy
  • Boot application server 

If the property “enable” is set to “yes” in the <JBOSS_INSTALL_DIR>/bin/jboss-profiler.properties file, the profiling is automatically started upon server startup. 

Note that you can also “manually” start the profiling by executing java -jar jboss-profiler-client.jar startProfiler 

Typical usage scenario 

  1. Start application server (profiling will also be started) 
  2. Use your application 
  3. Stop the profiling by going to <PROFILING_DIR> and executing following command: 

java -jar jboss-profiler-client.jar stopProfiler

  1. Generate human readable snapshot by executing: 

java -jar jboss-profiler-client.jar getSnapshot 1 

At this point, a new directory is created in <PROFILING_DIR> containing the details of the profiling snapshot.

Please, note that the report creation may take some time to complete. 

For an overview of the other command line options, you can execute java -jar jboss-profiler-client.jar

jbossprofilingcommands

For more info about command line options and configuration parameters, please refer to <PROFILING_DIR>/README.txt

 

 

 

 

 


Tagged as:

You must be logged in to post a comment.