Comments
rock333 wrote: At the IaaS Cloud layer virtualisation is going to be essential to allow the self service attributes, all painful and slow to do with physical hardware. Moving up the stack to PaaS and SaaS the use of virtualisation may, as you say, be less required if you put lots of smarts into your software. A lot of software does not have those smarts and by utalising virtualisation of the layers below can manipulate existing software architectures to have more cloudy attributes through automation (eg run load balancers and deploy more servers automagically). Over time, as new investment in software at...
Cloud Expo on Google News


2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
SYS-CON.TV
Top Links You Must Click On


Optimize it! by Intuitive Systems
Optimize it! by Intuitive Systems

Every chance I get, I lobby for performance tools for software developers, because performance tuning is hard. This is especially true in modern object-oriented languages like Java, as opposed to older languages like C where the programming model was much closer to the hardware model. Furthermore, performance can affect the user's perception of your software. Hence, for any serious software-development project it's critical to have good performance tools available to assist the tuning efforts. OptimizeIt 2.0 Professional from Intuitive Systems is one such tool.

OptimizeIt claims to work with most Java 1.1 VM's including the following:

  • Sun Microsystems JDK 1.1.1 through 1.1.6
  • Borland JBuilder 1.0
  • Symantec Café 2.5

    Test Environment
    I tested OptimizeIt on a Windows NT 4.0 system with a 200 MHz Pentium, 32 MB of memory (the minimum supported configuration) and the standard Sun JDK 1.1.6 installed. I ran OptimizeIt on several Java programs including one 200,000-line application.

    Installation and Documentation
    The installation was extremely smooth and uncomplicated. It required a mere 8 MB of disk space for the install. No hard-copy documentation was provided; however, the online documentation included a user manual (36 pages when printed) and a short tutorial. Both are in HTML format and viewed through your Web browser.

    Two Tools in One
    OptimizeIt actually contains two tools, a CPU time profiler and a memory profiler integrated into one GUI. Often, time and memory profilers are offered separately, but either one by itself gives you only part of your program's performance. By including both in a single program, OptimizeIt allows you to see both sides of the coin.

    Using the Product
    After specifying the program to run, such as CLASSPATH, source path(s) and then arguments, press the Start button in OptimizeIt to run the target program. It can be paused at any time to study the performance data up to that point and then resumed later. By default the memory profiler is always enabled and collects memory data continuously as the program runs, although it can be explicitly disabled if you wish. While the memory profiler is collecting data, it can be viewed in real time on the memory profile screen.

    For the CPU profiler you explicitly start and stop recording performance data. Generally, you would run the program up to the point where you want to begin measuring and press the Start CPU Profiler button. Then you wait until the program has finished the operation you want to measure and press the Stop CPU Profiler button. An option is provided to pause automatically before the start of the program in case you want to profile it from the very beginning. Unlike memory data, CPU data can't be viewed in real time as it's being collected. The CPU data becomes viewable when you stop recording.

    OptimizeIt is an interactive, live analysis tool. As long as the program and the JVM are live, you can get performance information. Once the program exits, however, the performance data is no longer available. Hence, an option is provided to disable exits so that even if the program calls System.exit(), the JVM is forced to remain alive so you can obtain the data.CPU Profiling Features
    The CPU profiler uses statistical sampling to determine how much time is spent in different parts of your program. The sampling interval is 25 milliseconds by default, but can be set as low as 5 milliseconds. Timing results are presented in a sorted hierarchical tree format that shows the top-level methods (e.g., the main() method in an application), their cumulative time (time spent in those methods plus all of their descendants) and percentage of total time (see Figure 1). You can then click on a node to cause it to expand and show all of the methods it calls directly, as well as their associated times. In this way it's easy to "drill down" the dynamic call graph of the program until you get to a leaf method. There is an option to invert the tree so that the bottom-most leaf methods are shown first and you can "drill up" to the top-level methods.

    This tree display is intuitive and easy to use. Some things, however, are difficult to see in this display. For example, it's not possible to see all the callers and callees simultaneously for a given method. In order to do this, you must switch back and forth between normal and inverted modes.

    Also shown on the CPU profile screen is a "hotspot" display, which lists methods sorted by the total time spent in each one, regardless of who called it. This is the display that clearly tells you which methods to focus your optimization efforts on.

    The really great feature about the CPU profiler is that data can be viewed for a particular thread or thread group; there's a hierarchical list in the program, including system threads (such as the AWT event thread) and a time line for each thread that shows when it was in a running or suspended state. This alone is a useful display, especially if your program has several threads. You can then select a thread or thread group from the list, and the tree and hotspot displays will show only data for that particular selection.

    By default, the display shows real time (CPU plus wait time); however, you can opt to see CPU time only. This is useful for tuning algorithms as it relates directly to the number of instructions executed.

    Memory Profiling Features
    The memory profiler shows object allocations aggregated by type. As previously mentioned, this display is continuously updated as the program runs, showing the current instance counts (and, optionally, sizes) for every object type. It would have been nice if it computed totals for you as well. There's also a checkpoint feature that allows you to set a baseline for the instance counts. Subsequent measurements will then show the counts relative to the baseline. They'll go up as new objects are allocated, and go down again when the garbage collector frees them. There's an option to disable the garbage collector, which is useful if you wish to see the total allocations over the life of the program.

    Unfortunately, this display doesn't include arrays. Since arrays can account for a majority of heap space in many programs, I found this to be a significant omission, although Intuitive promises to include this feature in the next version. Another feature I'd love to see is the ability to show memory profiles by thread or thread group, just as the CPU profiler currently allows.

    If you select an object type, you can then go to a second screen that shows, in a hierarchical tree format, the stack backtraces of all the places in the program where that type was allocated. You can go to a third screen that shows all instances of that type along with its values (the value shown is the result of calling the toString() method on the object). The instance screen also includes a unique and powerful heap analysis feature that shows you all incoming or outgoing references (but not both at the same time) to a given object instance. This is valuable because, although Java has an automatic garbage collector, it won't collect an object if you unknowingly keep a reference even though it's no longer needed. A heap analysis tool such as this is the only practical way to find such memory leaks. Apart from performance reasons, it can even be used as a debugging aid to inspect the connections between your data structures and find possible errors.

    Other Features

  • A source viewer is provided to display source code whenever you click on a method name, provided you compiled the code with the -g flag.
  • Printing is not supported directly, but you can export the data into HTML format and print from your browser. You can also export into ASCII or "importable" ASCII formats.
  • Advanced users will appreciate that a set of API methods are provided to enable and disable the profilers at the program level so as to gain even finer control on the parts of the program to be measured.

    Performance
    OptimizeIt generally performed well throughout my tests - a fact made more impressive considering it's written almost entirely in Java. Clearly the OptimizeIt engineers must have used the tool on itself! I did find switching between screens a bit sluggish on my small memory (32 MB) machine, but presumably this would be less of a problem on a larger memory system. I ran a benchmark program to measure the amount of overhead profiling. For the CPU profiler by itself, a 1.2x slowdown; for the memory profiler, there was a 2.2x slow down. This is quite reasonable, and I think most users are willing to tolerate it in return for quality performance data. With both profilers running simultaneously, I measured a slowdown of 2.4x. While OptimizeIt allows it, I don't recommend running both at the same time because the overhead of the memory profiler will affect the CPU profiler and can skew the results.

    Summary
    OptimizeIt provides a CPU profiler and a memory profiler, both of which are needed as part of a full-performance tuning effort. It's easy to install and operate. The outstanding feature of the CPU profiler is its ability to partition the timing data by thread or thread group; for the memory profiler it's a heap-analysis capability that allows you to track all references to and from a given object instance. OptimizeIt is a welcome addition to any Java programmer's arsenal of development tools.

    About Achut Reddy
    Achut Reddy is a staff engineer at Sun Microsystems in the authoring and development tools group, which is currently working on Java performance issues.

  • In order to post a comment you need to be registered and logged in.

    Register | Sign-in

    Reader Feedback: Page 1 of 1

    Enterprise Open Source Magazine Latest Stories . . .
    Integrated Windows Authentication (IWA) provides a user-friendly interface for single sign-on. IWA uses ‘Simple and Protected GSSAPI Negotiation Mechanism’ (SPNEGO) to allow the initiators and acceptors to negotiate the underlying protocol to be used for authentication. In this article...
    Preternaturally quiet since a hedge fund offered to buy it two weeks ago and take it private, Novell stated on Wednesday that the open source Ingres database is available in the free SUSE Studio as part of the SUSE Appliance Program. Novell and Ingres are supposed to jointly support an...
    Cloud Computing Journal caught up with the CEO of a major new player in the fast-emerging Cloud ecosystem - a CEO who has taken an interesting and unusual decision. While signing up as the Platinum Plus Sponsor of the 5th International Cloud Expo, he and his company have decided to rem...
    Open-Xchange, a provider of business-class open source collaboration software, today announced enhancements that give users telephone and fax integrated with e-mail, contacts, calendar and task information. By combining Open-Xchange (hosted and on-premise editions) with Unified Commun...
    Home Energy monitoring products maker People Power has come out with an open source hardware and software application developer kit called SuRF that lets embedded systems developers build energy saving apps for household electronics and devices on top of its Open Source Home Area Netwo...
    Novell and Ingres Corporation on Wednesday announced the Ingres database is available within SUSE Studio as part of the SUSE Appliance Program. Both companies have entered into a cooperative agreement to make it easier and more cost-effective for independent software vendors (ISVs) and...
    Subscribe to the World's Most Powerful Newsletters
    Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
    Click to Add our RSS Feeds to the Service of Your Choice:
    Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
    myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
    Publish Your Article! Please send it to editorial(at)sys-con.com!

    Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


    SYS-CON Featured Whitepapers
    ADS BY GOOGLE