Jump to content
We've recently updated our Privacy Statement, available here ×

  • djohnson53
    • Features: JasperReports Server Version: v5.1 Product: JasperReports® Server

    Introduction

    This tutorial covers basic performance diagnostic and tuning techniques for IBM JVM garbage collection. The tutorial focuses on basic memory problems and present command line settings that act as a starting point for improving garbage collection performance when running JasperReports Server.

    Product Version

    The tutorial works with any version that works with Java 5.0 or later.

    Objectives

    This guide will enable you to:

    Pre-Requisites

    • Basic administration of common J2EE web or application servers (tomcat, JBoss, GlassFish)
    • Required permissions to shutdown and restart the server and edit config files

    Assumption: Use of bundled Tomcat included with JasperReports Server. Adapt as needed for other application servers and platforms.

    Diagnosing Memory Problems

    Overview of diagnosing memory problems:

    • Launch JConsole
    • Have users use JasperReports Server or simulate load with QA tool
    • Watch memory usage
    StepAction
    1Edit {js-install}/apache-tomcat/bin/setenv.bat
    2

    Add the following JVM options to the JAVA_OPTS variable:

    • Dcom.sun.management.jmxremote
    • Dcom.sun.management.jmxremote.port=9004
    • Dcom.sun.management.jmxremote.authenticate=false
    • Dcom.sun.management.jmxremote.ssl=false
    3Restart JasperReports Server
    4Launch the <java-home>/bin/JConsole.exe application
    5

    Click the Remote tab and enter the following values:

    • Host or ip: {servername} (localhost if running locally)
    • Port: 9004
    • Username and Password: {leave blank}
    6Click the Memory tab
    7Either have users use JasperReports Server or use a load testing tool (such as LoadRunner) to simulate peak load conditions
    8

    Observe the memory usage characteristics. Normal usage will look like this:

    graph1.jpg.ba44d50c4b23b119b08529c085a7de44.jpg

    Whereas a situation where garbage collection is inadequate or nonexistent will look like this:

    garbagecollection2.jpg.2d489db3f064c646d5fd16c5913a1330.jpg

    If the “valleys” of the memory usage graph don’t return to a baseline, this is an indication of either a memory leak or garbage collection problem.

    See the Adding/Modifying JVM Command Line Options section below.

     

    Adding/Modifying JVM Command Line Options

    Change garbage collection algorithm in use:

    • Add/Modify JVM settings
    • Restart JasperReports Server
    • Watch memory usage
    StepAction
    1Edit {js-install}/apache-tomcat/bin/setenv.bat
    2

    Add the following JVM options to the JAVA_OPTS variable, where (n) is between 1 and the number of processors on the server:

    • Xgcpolicy:optavgpause
    • Xgcthreads(n)
    3Restart JasperReports Server
    4Either have users use JasperReports Server or use a load testing tool (such as LoadRunner) to simulate peak load conditions
    5Watch the <js-install>apache-tomcatwebappsjasperserver-proWEB-INFlogsjasperserver.log
    6Watch for OutOfMemoryExceptions
    7If an error occurs change the JVM heap space setting. See Increasing Heap Space and Perm Gen Space section below.

    Increasing Heap Space and Perm Gen Space

    Change JVM Heap and Perm Gen Settings:

    • Add/Modify JVM settings
    • Restart JasperReports Server
    • Watch memory usage
    StepAction
    1Edit <js-install>/apache-tomcat/bin/setenv.bat
    2

    Set the Xms and Xmx options to higher values in the JAVA_OPTS variable.

    For better performance, set the Xms and Xmx options to the same value.

    3Restart JasperReports Server
    4Either have users use the system or use a load testing tool (such as LoadRunner) to simulate peak load conditions
    5Watch the <js-install>apache-tomcatwebappsjasperserver-proWEB-INFlogsjasperserver.log
    6If the errors persist, repeat steps 2-5 until the errors disappear
    7If the errors persist after reaching the maximum allowable heap sizes (usually around 1.3 gb), consider migrating to 64 bit hardware or use additional server hardware in a cluster with a load-balancing appliance.

    What's Next?

    For additional information, refer to the following:

    Written by

    This tutorial was written by Steve Park, Professional Services Consultant, June 2009


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...