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 |
Tools: | GC log analysers| Multi-tenancy tools| Books| SizeOf| Thread analysers| Heap dump analysers|

Our valued sponsors who help make this site possible
JProfiler: Get rid of your performance problems and memory leaks! 

Training online: Concurrency, Threading, GC, Advanced Java and more ... 

Newsletter no. 2, January 19th, 2001

Get rid of your performance problems and memory leaks!

Modern Garbage Collection Tuning
Shows tuning flow chart for GC tuning

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

Java Performance Tuning, 2nd ed
The classic and most comprehensive book on tuning Java

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

Training online
Threading Essentials course

Get rid of your performance problems and memory leaks!

This month, there is a definite server based flavor to the articles I've added to my site. Several of the recently published performance articles are server focused. And my search backlog coincidentally also threw up some server related pages including several IBM papers on tuning Java in WebSphere, which provide useful generic server-Java tuning tips. (Note that apart from my book, all product related listings are for your information, and should not be considered as an approval or disapproval of that product. I do recommend my book, of course.)

For those of you with any experience in developing server cores (the underlying server framework, not EJBs etc.), you may be delighted to hear about Matt Welsh's non-blocking I/O library. This uses the JNI to give access to the select(2)/poll(2) system call, allowing efficient multiplexing of multiple i/o streams without using a thread per stream.

Finally, this month Kirk Pepperdine starts a useful roundup of Java performance discussion groups.


I haven't had time to extract the tips from these two yet.

Recent articles

All the following page references have their tips extracted below.

Articles, papers & packages less than six months old

New from us

My colleague Kirk Pepperdine will be producing his own idiosyncratic roundup of some of the interesting discussions from the various Java performance discussion groups. We currently know of the two at TheServerSide and JavaRanch. If you know of any other Java performance discussion groups, please let us know (mail us from this page).

Kirks article follows just below.

Other additions to the website

I've extracted the tips from even more pages beyond those listed above, and I've also listed some interesting performance reports and a couple more tools.

Jack Shirazi

Kirk's roundup

When I first pointed my browser at, "What?" I couldn?t help but thinking, "What is this?. The theme is corny but they are offering a chance to win a book." So, I dutifully filled out the registration form and then started to browse. The topic in the performance forum, "Most common costliest Elements of Java", looked interesting and there were a number of responses so, I clicked in.

Although the question seemed fairly ordinary, the responses clearly demonstrated that this site was anything but corny. A quick summary of the thread would be: "object creation, casting, synchronization and exceptions are the most costly elements of Java". Of the four, I will focus here on exceptions.

The performance impact of using Exceptions is becoming better known. What is not so well known is why Exceptions degrade performance. In the discussion, Peter Haggar does a masterful job of explaining what happens when you create and throw an exception. The cost of using exception shows up in several ways. First, throwing an exception means that you?ve just created a new object. But, as Peter points out, the constructor in Throwable calls the native method, fillInStackTrace(). This method walks the stack frame collecting trace information. Peter then goes on to point out that using exceptions requires extra bytecodes. Using exceptions requires an additional table in the class file. Throwing an exception disrupts the normal flow of the execution in the JVM. The JVM must take the costly step of fixing the call stack when an exception is thrown. In the end Peter quite rightfully points out that you should "use exceptions for error conditions, not for control flow."

The density of usable information on this discussion group makes it a very worthwhile trip. I look forward to reviewing this group and others for future editions of this newsletter.

Kirk Pepperdine

Some performance tips (Page last updated January 2001, Added 2001-01-19, Author Shyam Lingegowda). Tips:
Good Java practices, some of which are good for performance. This page has already been listed on the Tuning Tips page, and the following tips are new items that have been added to the page since it was last listed (Page last updated January 2001, Added 2001-01-19, Author Dave Jarvis). Tips:
Detailed article on load testing systems (Page last updated January 2001, Added 2001-01-19, Author Himanshu Bhatt). Tips:
Article about frameworks and the effective memory management of objects; avoiding memory leaks by design. (Page last updated January 2001, Added 2001-01-19, Author Leonard Slipp). Tips:
Article on using syslog to track performance across distributed systems (Page last updated December 2000, Added 2001-01-19, Author Brian Maso ). Tips:
"EJB2 clustering with application servers" (Page last updated December 2000, Added 2001-01-19, Author Tyler Jewell). Tips:
Sun community chat session with Bill Shannon, Kevin Osborn, and Jim Glennon on JavaMail (Page last updated December 2000, Added 2001-01-19, Author Edward Ort). Tips:
Whoopee!! A non-blocking I/O library for Java. This is the single most important functionality missing from the SDK for scalable server applications. The important class is SelectSet which allows you to multiplex all your i/o streams. If you want a scalable server and can use this class then DO SO. (Page last updated November 2000, Added 2001-01-19, Author Matt Welsh). Tips:
Java I/O tutorial by Elliotte Rusty Harold (author of O'Reilly's Java I/O book). (Page last updated November 2000, Added 2001-01-19, Author Elliotte Rusty Harold). Tips:
Article on using smart proxies. (Page last updated November 2000, Added 2001-01-19, Author M. Jeff Wilson). Tips:
Hans Bergsten's top ten JSP tips (Page last updated November 2000, Added 2001-01-19, Author Hans Bergsten). Tips:
Paper detailing the "Best Practices for Developing High Performance Web and Enterprise Applications" using IBM's WebSphere. All the tips are generally applicable to servlet/EJB development, as well as other types of server development. (Page last updated September 2000, Added 2001-01-19, Author Harvey W. Gunther). Tips:
Tuning IBM's WebSphere product. White paper: "Methodology for Production Performance Tuning". Only non-product specific Java tips have been extracted here. (Page last updated September 2000, Added 2001-01-19, Author Gennaro (Jerry) Cuomo). Tips:
Sun community chat session with Steve Wilson and Jeff Kesselman on Java Performance (Page last updated August 2000, Added 2001-01-19, Author Edward Ort). Tips:,2627,0201616467,00.html
Peter Haggar's Practical Java Programming Language Guide. (Page last updated 2000, Added 2001-01-19, Author Peter Haggar). Tips:
WebSphere V3 Performance Tuning Guide (Page last updated March 2000, Added 2001-01-19, Authors Ken Ueno, Tom Alcott, Jeff Carlson, Andrew Dunshea, Hajo Kitzh?fer, Yuko Hayakawa, Frank Mogus, Colin D. Wordsworth). Tips:

Practical Java Programming Language Guide by Peter Haggar. This book includes a good-size section on performance. The Praxis list from that section is on the Tuning Tips page.

A "we're great and they suck" performance comparison by IBM of IBM WebSphere vs. Microsoft IIS.
Non-technical article with basic performance comparisons of some leading application servers (Page last updated November 2000, Added 2001-01-19, Author Rich Seeley). Tips:
Steven Meloan's in depth look at the HotSpot Performance Engine (June 1999)
The Java Performance Report, Part III from September 2, 2000, by Osvaldo Pinali Doederlein. If you are still looking for comparitive performance reports (JVM vs JVM, Java vs C), this is pretty useful.

WebSphere Studio Page Detailer
TowerJ Application Performance Analyzer

Jack Shirazi

Last Updated: 2024-03-29
Copyright © 2000-2024 All Rights Reserved.
All trademarks and registered trademarks appearing on are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries. is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
RSS Feed:
Trouble with this page? Please contact us