Can anyone recommend a web site that includes up to date performance tips for Java? Most of the sites I have found seem to be old and I guess the newer versions (1.5 – 1.7) may have obsoleted some recommendations.
Edit:
I’m mostly concerned with reducing memory usage/garbage collection and making sure that simple methods can be inlined if necessary.
The code involves processing large amounts of data in threads using lots of small objects. Some objects are created for each data item, while others live longer. These objects usually implement an Interface or extending an abstract class.
Update: For me, the reference document to tune a Sun virtual machine is Java SE 6 HotSpotTM Virtual Machine Garbage Collection Tuning (that will also give you a methodology).
As mentioned in a comment, the ergonomics feature does a pretty good job at tuning a modern JVM and should be tried first before to test more detailed controls.
If you don’t get satisfying results, set the max Heap size and start to play with the generation sizes and more precisely the Young Generation. From the FAQ about Garbage Collection in the HotspotTM JavaTM Virtual Machine:
I’d follow the suggested approach:
Then, if the application does still not achieve the desired performance, start with a different collector (see Selecting a Collector).
Actually, just read the whole document carefully (and be sure to understand the implications of a bad decision 🙂 And don’t forget:
References
Below my initial answer that some readers might still find interesting:
Java Performance Tuning is a well known reference for Java performance and still updated. You might also want to check the blog of the Kirk Pepperdine (which is actually a contributor of the previous site).