JDK-6453531 : Severe performance regression on long methods for server VM
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: linux
  • CPU: x86
  • Submitted: 2006-07-27
  • Updated: 2011-02-23
  • Resolved: 2006-07-27
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
Java(TM) SE Runtime Environment (build 1.6.0-beta2-b86)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0-beta2-b86, mixed mode)
Java(TM) SE Runtime Environment (build 1.6.0-beta2-b86)
Java HotSpot(TM) Client VM (build 1.6.0-beta2-b86, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Linux  2.6.12-1.1381_FC3 #1 Fri Oct 21 03:57:59 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux
Linux  2.6.12-1.1381_FC3smp #1 SMP Fri Oct 21 04:03:26 EDT 2005 i686 i686 i386 GNU/Linux


EXTRA RELEVANT SYSTEM CONFIGURATION :
Dual Xeon hyper-threaded machines

A DESCRIPTION OF THE PROBLEM :
We have noticed a severe performance regression in our production code with 1.6.  We have narrowed it down to one long method (~1000 lines).  It appears from preliminary analysis that the VM is refusing to compile the method past the first ~60 lines.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) Compile the attached code under 1.5.
2) Run on a 32-bit VM in both client and server modes and compare timings under 1.5 and 1.6
3) Run on a 64-bit VM and compare timings under 1.5 and 1.6


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The performance with the server VM should be much better than the performance with the client VM; performance under 1.6 should be the same or better as performance under 1.5.

Plotting the breakdown of the timing of the loop iterations we should see that the first couple of iterations go slowly, then the code should get compiled and run much faster.  We might expect that the client VM is less aggressive about compiling code and hence overall timing will be slower for the client VM
ACTUAL -
The testcase runs much slower under 1.6 than 1.5 with portions of code running 10x slower! It looks like the server VM is not compiling the method.

32-bit client 1.5:  33 seconds
32-bit client 1.6:  58 seconds
32-bit server 1.5: 5.5 seconds
32-bit server 1.6: 57 seconds
64-bit server 1.5: 5 seconds
64-bit server 1.6: 20 seconds

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Attached Seperatly
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Try and break method up into shorter methods

Release Regression From : mustang
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Release Regression From : 5.0u6
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Release Regression From : 5.0u6
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Comments
EVALUATION Compilation of very large methods (>8000 bytes) is not well-tested and expensive. The VM is tuned for compiling for the common programming paradigm, which includes generally small methods. The user can work around the issue with the VM flag -XX:-DontCompileHugeMethods.
27-07-2006

WORK AROUND Use the VM flag -XX:-DontCompileHugeMethods
27-07-2006