Oracle Java and AllocatePrefetchStyle for “Bulldozer” Processors
This blog describes an option, -XX:AllocatePrefetchStyle=0, that may help performance when using a Java 6 (or older) Oracle JVM and running on an AMD Bulldozer core processor. In our labs, this option was observed to give performance lift typically between 5 and 15% on many workloads. As usual, uplift on your own workload may vary.
AMD’s second generation architecture of core processors codenamed “Bulldozer” was released in 2011 (products included AMD Opteron™ 6200, AMD Opteron 4200 and FX Processors). These processors include a more advanced hardware prefetcher which is able to pick up more varied data access patterns than previous generation processors.
Oracle JVMs by default use software prefetch instructions to prefetch heap memory when allocating new objects on the heap. (Java applications tend to do a lot of heap allocations). Sometimes the software and hardware prefetching can get in each other’s way. We discovered that for most Java workloads the best performance on Bulldozer family processors could be achieved by just using the hardware prefetcher and disabling the software prefetching.
AMD worked with Oracle to get this no software prefetch strategy into the Java 7 release (released in July 2011) as the default for these Bulldozer processors. For those still using Java 6 or earlier releases, the same effect can be achieved by explicitly using the following option on the java command line: –XX:AllocatePrefetchStyle=0.
Tom Deneau is a Senior Member Technical Staff in the Runtimes Team at AMD. His postings are his own opinions and may not represent AMD’s positions, strategies or opinions. Links to third party sites, and references to third party trademarks, are provided for convenience and illustrative purposes only. Unless explicitly stated, AMD is not responsible for the contents of such links, and no third party endorsement of AMD or any of its products is implied.