Java Performance Tuning

Java(TM) - see bottom of page

|home |services |training |newsletter |tuning tips |tool reports |articles |resources |about us |site map |contact us |

Our valued sponsors who help make this site possible
Read "Effective Performance Testing In Enterprise Java Environments" 

Wily Technology- Manage performance of applications, portals, and integration 

APM + Diagnostics across the lifecycle = dynaTrace software 

Tool Report: Borland Optimizeit Enterprise Suite

Java/.Net Performance Management | White Paper
Learn how to manage performance from data/app level to service/business process level

eoSense real-time visualisation
Gives an unprecedented level of understanding of your application


Java Performance Training Courses
COURSES AVAILABLE NOW. We can provide training courses to handle all your Java performance needs

See Your Message Here
You could have your tool advertised here, to be seen by thousands of potential customers

Java Performance Tuning, 2nd ed
Covers Java SDK 1.4 and includes four new J2EE tuning chapters

Java Performance Tuning Newsletter
Your source of Java performance news. Subscribe now!
Enter email:


Quest Software
Read "Effective Performance Testing In Enterprise Java Environments"

Wily Technology
Manage performance of applications, portals, and integration

dynaTrace Software
APM + Diagnostics across the lifecycle = dynaTrace software


Java/.Net Performance Management | White Paper
Learn how to manage performance from data/app level to service/business process level

eoSense real-time visualisation
Gives an unprecedented level of understanding of your application


Published October 2003

The JavaPerformanceTuning.com Tool Reports are designed to help readers make informed choices about the tools they may wish to use. JavaPerformanceTuning.com provides these reports as a service to our readers; JavaPerformanceTuning.com is not responsible for the information provided by the tool author or vendor, nor do we necessarily endorse the products mentioned. JavaPerformanceTuning.com is not responsible for any additional resources provided from the article (such as downloadable files or other accessible material), even where we host such material.

A breakthrough solution for isolating and resolving performance hazards, Borland® Optimizeit™ Enterprise Suite 5.5 ties together application-wide J2EE™ metrics with deep code-level granularity. The first solution of its kind, Borland Optimizeit Enterprise Suite combines award-winning Borland® Optimizeit™ Suite - memory and CPU profiling, thread and coverage analysis -with an advanced, higher-level J2EE dashboard. System-level JDBC, ® JMS, JNDI, JSP™ and EJB™ performance is immediately prioritized and linked directly to drill-down, root-cause diagnostics. Optimizeit Enterprise Suite equips developers with a comprehensive toolkit for regularly optimizing code and managing application quality.

This article provides an overview of Optimizeit Enterprise Suite, showing how the advanced capabilities can be used to solve two real-world Java application efficiency problems.

Overview

Optimizeit Enterprise Suite contains four tools to help you pinpoint and resolve code-level performance issues in any Java code:

  • Optimizeit Profiler, including memory and CPU profiling
  • Optimizeit Profiler allows developers to rapidly pinpoint, assess, and resolve performance issues, such as memory leaks, performance bottlenecks, and excessive temporary object allocations

  • J2EE component-level profiling
  • J2EE profiling capabilities enables developers to locate component-level performance bottlenecks on their local workstations

  • Optimizeit Thread Debugger
  • Optimizeit Thread Debugger makes it quick and easy to tackle Java™ thread issues such as thread starvation, contentions, excessive locking, and deadlocks

  • Optimizeit Code Coverage
  • Optimzeit Code Coverage allows developers to view in real time how frequently each class, method, and line of code is executed. Code Coverage can easily be included in automated batch testing sessions, and it allows for report generation.

    Getting started with Optimizeit Enterprise Suite

    To start profiling your Java application with Optimizeit Enterprise Suite, you’ll need to follow a few easy steps to attach Optimizeit profiler to your application. When you start any of the Optimizeit tools that comprise Optimizeit Enterprise Suite, the Edit Setting dialog window will appear requiring you to configure the settings.


    The Settings dialog window contains these tabs:




    Once you have configured the settings, you can save them in a file ready to re-use whenever you profile the application again.


    Optimizeit Enterprise Suite provides easy-to use integration wizards to integrating will popular applications servers and IDEs. For detailed information integration information please visit http://info.borland.com/techpubs/optimizeit/


    Use Case Scenario

    For the purpose of this report, we’ll show you how to swiftly isolate memory leaks using Optimizeit Enterprise Suite’s Automatic Memory Leak Detector.


    We’ll illustrate how to use Optimizeit Enterprise Suite by profiling an application called Golf4Geeks.com. This is a typical J2EE-based enterprise e-commerce application with front end as JSP and HTML interface and back-end as EJBs includes Entity Beans, Session Beans and Message-driven Beans(MDB). This application has little more than 100 files developed using Borland JBuilder 9 Enterprise.


    We start our profiling session by configuring the Edit Settings panel, and simply clicking “Attach Now”. Optimizeit Profiler immediately begins collecting real-time information from the application.




    We’ll test the “Customers” functionality of our application to verify that it’s performing as expected.




    To start checking for potential memory leaks we’ll need to first take a look at the heap view. We’ll also need to select the option to “Disable garbage collector” as we need to find the memory leak despite the garbage collector running. Another useful option to select at this stage is the object size display – this is done easily using the options in the Inspector.





    We now enforce the Garbage Collector and then take a look at the instance counts. As we can see that keynote.util.CachedObject is allocated 484 times even after the Garbage Collector has run. This value clearly stands out as being high, so let’s see if this is a memory leak.


    We’ll do this using the Automatic Memory Leak Detector [AMLD] – by pressing the AMLD button this captures the heap activity at a given time. By creating multiple heap activity states, AMLD automatically compares them to track down memory leaks.



    As you can see we just captured heap state #1 with a heap-used value of 19Mb from the total heap size of 127Mb.


    The next step is to repeat the steps performed in the test application a few more times and monitor the impact. So let’s run our test case few times- say 4 times - and then check on the heap state in the AMLD view.




    The results of the test show that the heap used is same in Heap state#1 and Heap state#2. However, we can see that object “Object[] 0x6067800” was allocated 14834 times between the heap states. Let’s investigate this further by double-clicking it to access a graph view.



    This shows the call graph and provides more detail regarding the object under investigation, revealing how was instantiated. Note that AMLD shows the potential memory leaks in red, so let’s drill-down to the source of where this is coming from. We can open the reference graph by right clicking on the red object. This takes us to a reduced reference graph, displaying the sequence of allocation for the selected object.



    In the bottom pane you can see the sequence of Jakarta Tomcat - > jsp_service, then allocated at doStartTag, then all the way to keynote.util.Cachedmanager.putCache().


    Let’s open the source to confirm that this is a memory leak and isolate the exact root cause.




    This reveals that in putCache method, cacheHashMap.put() a method is called to put the object into the cache. It seems that the object is constantly being put into the cache and not being removed, essentially leaking the cache. This confirms that we have indeed tracked down a memory leak, that may not appear to be critical at this stage, but that over time could crash the JVM upon which runs your entire business application.

    Conclusion

    In just a few easy steps we have demonstrated how Optimizeit Enterprise Suite can save you a lot of time and frustration spent trying to track down and solve performance hazards such as memory leaks. Optimizeit Enterprise Suite also helps with solving excessive temporary object allocations, CPU bottlenecks, thread issues as well as advanced J2EE profiling capabilities to address component-level bottlenecks.

    The extensive capabilities of Optimizeit Enterprise Suite are designed to be available at your fingertips to help you solve a multitude of performance issues as you develop your code. Eliminating performance glitches as you go proves to be a much more efficient and less arduous process in the long run, so try Optimizeit Enterprise Suite today!

    For more information and a free 10-day trial please go to: http://www.borland.com/optimizeit/index.html


    Last Updated: 2008-05-01
    Copyright © 2000-2008 Fasterj.com. All Rights Reserved.
    All trademarks and registered trademarks appearing on JavaPerformanceTuning.com are the property of their respective owners.
    Java is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries. JavaPerformanceTuning.com is not connected to Sun Microsystems, Inc. and is not sponsored by Sun Microsystems, Inc.
    URL: http://www.JavaPerformanceTuning.com/tools/optimizeit/index.shtml
    RSS Feed: http://www.JavaPerformanceTuning.com/newsletters.rss
    Trouble with this page? Please contact us