Tuning Java applications
By tdw on Dec 15, 2004
Barely without exception, the reply from the people-who-know is to use some arcane option or combination of options to the Java VM.
Now, the thing that irritates me (and yes, this is a rant) is that whilst these options are no black magic, they are pretty close to it, and it relies on the application deployer to be able to convey their performance issue in the correct terms, and the right person-who-knows to interpret that and pass on the appropriate suggestion using -XXflag. My problem is that I don't think that this should be necessary. Why do these options exist at all, except in an experimental environment where testing is required to determine how to get the best from the VM ?
Sure, I appreciate that the JVM is a complex beast (particularly in the area of GC), and different configurations are required for a lightweight client as opposed to a heavyweight server app (this, after all, is why we have the "-server" and "-client" options.
What I think is required is a dynamic tuning mechanism which allows the JVM to monitor itself and then adjust its configuration based on a number of parameters such as throughput, number of incoming/outgoing connections, database activity, etc. This probably requires an application of AI, but given that there is a good profiling interface to the JVM, maybe it wouldn't be that difficult to do (for someone with a brain the size of a small planet).
Oh, and in case you think I'm just picking on Java, try figuring out what options to use to the C/C++ compilers to get the best performance out of your code, and you'll see a very similar problem. Gone are the days when "-O4" was all that was needed :(
I'd like to put addressing this voodoo to the top of my Christmas list so it makes it easier for me as a developer and for application deployment teams to get the best from their apps.
Or perhaps we just need faster CPUs and faster memory busses ?