Product ReviewJava Performance Gets a BoostOptimize It! 4.0
All software developers want to achieve optimum application performance. Java developers in particular need to wring the last drop of performance from their applications. But to tune up an app, you have to know a few things, such as where it's spending most of its compute cycles and how efficiently it uses system resources. You have to be able to pinpoint and eliminate bottlenecks, plug memory leaks, ferret out inefficient algorithms, and unearth inefficient processor usage.
Shipped in September 2000, Optimize It! 4.0 from Intuitive Systems is a Java-code profiling tool designed to do all of the above. According to the vendor, it helps Java developers improve the performance of servlets, JavaBeans, Java Server Pages, and complex server-based Java applications. This latest version has lots of new features, including universal JVM support, offline profiling for testing programs in production environments, and the ability to integrate with a wide range of application servers.
In December, Java Report's writers chose Optimize It! to receive a Writers' Choice Award as the year's top testing tool. This one was a big vote-getter (no hand recount requests, please!), and so we asked San Francisco-based software developer Lea Walker to download the trial version and find out what made it so popular.
John K. Waters
Product Review Editor
||Version Reviewed: 4.0
Current Version: 4.0
|CUP RATING SYSTEM:
5 Outstanding 4 Very Good
3 Acceptable 2 Has Potential 1 Poor
INTUITIVE SYSTEMS DESCRIBES Optimize It! 4.0 as a comprehensive language-profiling tool for Java that enables developers to improve the performance of Java programs, including servlets, EJBs, and JSPs. A modest claim, and one that was borne out by my experience with the product. I found Optimize It! to be a comprehensive suite of tools that made it surprisingly easy to quickly locate code inefficiencies and memory leaks. And with full support for Sun's JDK 1.1, and versions 1.2 and 1.3 for J2SE, it offers users a real range of choices for profiling and optimizing Java code.
Written in Java, Optimize It! lets users track the CPU and memory usage of any Java component, whether or not source code is available. There's full support for viewing Java threads and the details of Java's garbage-collection mechanism. A variety of graphs and reports, including HTML, are available to show users exactly what's happening in their Java code.
I downloaded the trial version of the product, which anyone can try for 15 days, and installed it on a Windows NT workstation. I had no problems with the installationin fact, it was a breeze. The configuration process was simple and straightforward, guided by a set of comprehensive wizards. You do have to configure a default JVM during the install, but you can change it anytime afterward. Optimize It! stores the locations of all JVMs discovered, so switching between them is simple.
To put the product through its paces, I profiled a Java 2-based applet and a servlet based on the Java SDK 2.0, both of which I wrote with lots of lousy code: temporary objects, methods used as the terminating state for control blocks, the String class overused when StringBuffer would have been more efficient.
Profiling applets and servlets proved to be an easy task in Optimize It!. Once the JVM was configured, I selected "Applet" from the startup tab in the settings dialog box, and then entered the path to the HTML containing my applet in the "Applet HTML or URL" field. Then I simply hit the "Start Now" button.
Profiling servlets, JSPs, and remote applicationsin my experience, a frustrating and often fruitless exercisewasn't much more complicated, and the process yielded a wealth of useful information. I simply entered the path to the servlet class, and a browser popped up and executed the servlet while Optimize It! displayed its profiling results.
Optimize It!'s memory profiler counts the number of instances allocated by class, and lets users see which method instantiated which instance. I used it quite effectively to track down the many temporary object allocations I had coded into my applet and servlet. The memory profiler can also help to ensure that all instances of objects are garbage collected, removing any memory leaks in the code.
Optimize It!'s CPU profiler shows users which methods are "sucking" computing cycles. This is where the rubber really hits the road, as far as application performance is concerned. Identify which methods require the most CPU cycles, and you've got a place to start looking for performance problems in the code. The CPU profiler can be set up to start automatically, but Optimize It! doesn't offer suggestions on what may be causing the performance problems. Still, it gives users an X-marks-the-spot heads up so they know where to start digging. During my test, the CPU profiler pointed out the piggiest methods in both applets and servlets, allowing me to spend my optimization efforts, well, optimally.
Optimize It! provides useful views of the resources being used by a profiled application. You can view information about the VM that's running, including details about the heap, number of threads, loaded classes, and garbage collection. This feature is quite useful for defining an application's minimum system requirements before distribution. Also, I was able to select a method I noticed was gobbling CPU cycles, click on the "View Source" button, and have the CPU profiler display the source of the method.
Once I found the performance problems in my test applet and servlet, replacing the clunky code was a simple matter. With the changes in place, I used Optimize It! to reprofile the software, which showed much improvement.
Among the new features in the 4.0 version, I particularly liked the product's offline profiling capability. As the vendor says, it provides users with the ability to record performance data with such limited overhead that it becomes possible to monitor the performance of applications in production. This feature allows you to save performance data and load it into Optimize It! later for analysis or comparison.
The product's ability to detect performance problems in application server environments is another new feature. Although I didn't have a chance to do much with it, I suspect it will prove to be an important capability for many developers. The product integrates with a bunch of app servers and servlet engines, including:
- Allaire JRun
- Apache JServ and Tomcat
- Apple WebObjects
- ATG Dynamo
- BEA WebLogic
- IBM WebSphere
- iPlanet Web Server Enterprise Edition
- Sun ServletRunner and JavaWeb-Server
- Unify eWave ServletExec
Optimize It! provides detailed help on configuration for several application servers and servlet engines. It provides detailed instructions for integrating some other products not directly supported.
And the universal Java VM support is great. It enables developers to profile their Java applications running on any Sun-standards-compliant JVM.
Most features of Optimize It! are available for all versions of Java, but somee.g., filtering to remove fast methods and display of invocation countsare available only for Java 2. Filters for both memory and CPU profiling (see Figure 1), saving snapshots of profiling sessions, and integration with application servers and IDEs are available for all versions.
Figure 1. Optimize It! memory profiler.
I found Optimize It! to be a great tool, easily a "must try" for any developer looking to reduce cycle times and improve the overall performance of his/her Java applications. At the end of the day, it's all about making your Java code run faster and more efficiently. This product really does make it easy to spot the code responsible for excessive memory allocations and inefficient CPU usage. I'm not sure what more I would want from a performance profiler.
Readers have told us that testing has become a real priority in most software development organizations. Yet debugging and troubleshooting by its very nature can be tedious and time consuming. It can be an especially irksome task when everyone in the company is howling about reducing time-to-market out of one side of their mouths, while yodeling about maintaining high-performance standards out of the other side.
If there are other testing and performance profiling tools you'd like us to review, let us know. Send e-mail to Product Review Editor John K. Waters at [email protected].
|Review in a Nutshell
- Provides detailed runtime feedback of a program's computer resources utilization.
- Universal JVM support.
- Integrates with a wide range of app servers.
- Some features available only for Java 2-based apps.
- A little pricey.
Lots of useful features. Easy to use. Provides Java developers with the insight they need to boost an application's performance. Overall great tool. Well-worth a look.
Supported Operating Systems:
- Windows NT, 95, 98, and 2000.
- Sun Solaris Sparc/UltraSparc; Solaris 2.5.1, 2.6, 2.7, 2.8; and Solaris Intel 2.5, 2.6, 2.7.
- Linux i386, certified on RedHat 6.0, 6.1, 6.2.
- Includes full support for Sun's JDK 1.1 and Java 2 v1.2 and v1.3 SDK Standard Edition.
Pricing and Availability:
Optimize It! 4.0 is available now. Product pricing starts at $499. (Intuitive Systems representatives say volume discounts are available.) A 15-day trial version is also available for free download at www.optimizeit.com/download-demo.html.
|IBM's Solution & Integration Software Group Uses Optimize It! to "See Under the Covers"
|Bill Krebs is an advisory programmer at IBM's Solutions & Integration Software Group. Mr. Krebs' team develops IBM products for administration using XML and Java Servlets to provide Web-based solutions. His team is currently developing a Java servlet to run on a wide variety of operating systems and application servers. He is using Optimize It! 4.0 "to quash performance problems and resource leaks before we get to the end of the development cycle."
Java Report: Why did you decide to include a performance profiler among the tools you're working with on the servlet project?
Bill Krebs: We want our servlet to be rock solid. This means we must understand the demands our code places on the server, and ensure we have no memory leaks. In the future, other developers will plug into our API, so having a tool to tell us whose code is stressing the system is vital.
JR: Where are you in the development cycle?
BK: Right now we're reviewing our code to guide us in designing efficient solutions to the most resource-intensive areas of our product. As we do this, we learn from seeing under the covers of the system as it runs, and we are using that information to be better developers on each project we tackle.
JR: And you're using Optimize It! to "see under the covers"?
BK: Yes. One of the outputs of this tool is better code, [another] is wiser developers.
JR: How many such tools did you evaluate? How did you go about it?
BK: I focused my evaluation on Optimize It! 4.0 and JProbe 2.8. Both [are] promising tools and have excellent features. Using demo versions and reading about the product details on their Web sites helped me to make the best use of the time I had for product evaluation.
JR: Why did you settle on Optimize It!?
BK: I found Optimize It! was easier to configure and get up and running quickly in my environment [Apache Tomcat Application Server]. Optimize It! offers a clean design, and it's highly usable. It did what I needed, and the features I didn't need immediately did not get in my way. Once I was up and running, I liked what I saw. The ability to filter data by Java package helped me focus my analysis time. The highlighting of source code helped me to pinpoint offending code.
As I worked with the tool, it didn't take long to get to where I could delve into my code to study the areas I was most interested in: checks for memory leaks, data on memory consumption, and CPU profiling by thread and object. I was pleased with the range of supported JVMs, application servers, and operating systems. I found it easier to set up to run under my target application server with Optimize It!, which was important to my choice.
Finally, I read about some nice features I could grow into, including the performance profiling API, which would let me start or stop data collection from a certain point in my code. I haven't used it yet, but the ability to integrate with several major IDEs looked neat. I was also intrigued by the ability to do remote profiling.
JR: What do you like least about the product?
BK: It took me a little time to figure out how to control the output when I was exporting my data. And it took me a while to figure out how to export both my memory and CPU data at first.
JR: What things could use some improvement in the next version?
BK: I think it would be a good idea to add some additional export/reporting options, while maintaining the tool's ease of use. For me at least, that would be a helpful addition to Optimize It!.