Java Tunings for Server Side XML Processing
By binu on Feb 22, 2006
The XML parser benchmark that we released, XMLTest is designed as a server side benchmark and appropriate Java tunings should be applied to obtain optimal performance. This is especially true if you use this benchmark to compare the performance of different parsers.
At the minimum, use the following Java options when you run these tests on 32-bit Windows: -server -Xmx -XX:+UseParallelGC
Based on J2SE 5.0 ergonomics, the default runtime compiler for Windows on the i586 platform is the client compiler, even for server class machines (one with 2 CPUs and at least 2GB of physical memory). In case you are wondering why, the 'Ergonomics in the 5.0 Java Virtual Machine' document cites the following reason - This choice was made because historically client applications (i.e., interactive applications) were run more often on this combination of platform and operating system. Since XMLTest is a server side benchmark, we need to enable the server runtime compiler using the -server option.
Garbage Collector Ergonomics describes the various default garbage collection options selected by the VM. Since parallel GC is not the default, add -XX:+UseParallelGC option to turn it on. By default, the max heap size is selected as the smaller of 1/4th of the physical memory or 1GB. It is important to understand these limits and tune them appropriately, especially for the parsing on large DOM documents.