JDK-8047216 : Sudden increase of frame size
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2014-06-18
  • Updated: 2015-07-27
  • Resolved: 2015-07-27
Related Reports
Relates :  
Description
It looks like there is a big increase of frame size in JDK 8. 
For testing I use simple program, which measures a deep of recursion:

public class StackOverflow {
    static int level;
    
    public static void main(String[] args) {
        try {
            new StackOverflow().recurse();
        } catch (StackOverflowError e) {
            System.out.println("Final Level "+level+" for JDK "+System.getProperty("java.version"));
        }
        
    }
    
    void recurse() {
        level++;
        if (level%100 == 0) System.out.println("Level "+level);
        recurse();
    }
    
}

There is a infinite recursion and the program measures how deep it can go before StackOverflowError happened. Interesting thing is that there is a big difference between JDK 7 and JDK 8. I am running the test on solaris sparc using 64bit JDK with fixed stack size Xss2M - to rule out different stack size defaults. Here are the results of command "binaries/solaris-sparcv9/bin/java -Xss2M -jar StackOverflow.jar" for different JDKs:
JDK 1.6.0_65-b14    15992
JDK 1.7.0_60-b19    15991
JDK 1.8.0-b132          4914
JDK 1.8.0_20-ea-b19 4843
JDK 1.9.0-ea-b18       4843

There is a significant difference between JDK 7 and JDK 8. It looks like this regression happened sometime after JDK 1.8.0-ea-b101, since this build still returns 15050. Similar regression can be observed on other platforms (Linux, Mac OS X) although it is not that big as on solaris/sparc.

Comments
Closing this as WNF based on Coleen's comment.
27-07-2015

The frame size isn't larger. This is due to the increase in StackShadowPages on solaris 64 bit to match linux because there's a socketRead0 call that uses a lot of stack and important things were getting SEGVs rather than stack overflow errors. So this isn't an issue we will fix. You can add -XX:StackShadowPages=6 to get the old behavior.
11-07-2014

-Xint doesn't show the same variance around b115/b116, which is curious. bus2001077 /scratch/dh198349 > for build in b100 b101 b102 b103 b104 b105 b106 b107 b108 b109 b110 b111 b112 b113 b114 b115 b116 b117 b118 b119 b120 ; do echo /java/re/jdk/8/promoted/all/$build/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow; /java/re/jdk/8/promoted/all/$build/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow; done /java/re/jdk/8/promoted/all/b100/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 43076 /java/re/jdk/8/promoted/all/b101/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 43076 /java/re/jdk/8/promoted/all/b102/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 43076 /java/re/jdk/8/promoted/all/b103/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 43076 /java/re/jdk/8/promoted/all/b104/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 43076 /java/re/jdk/8/promoted/all/b105/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 43076 /java/re/jdk/8/promoted/all/b106/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 43076 /java/re/jdk/8/promoted/all/b107/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 43076 /java/re/jdk/8/promoted/all/b108/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 43076 /java/re/jdk/8/promoted/all/b109/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 43076 /java/re/jdk/8/promoted/all/b110/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 20848 /java/re/jdk/8/promoted/all/b111/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 20848 /java/re/jdk/8/promoted/all/b112/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 20848 /java/re/jdk/8/promoted/all/b113/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Java HotSpot(TM) 64-Bit Server VM warning: Shutting down compiler C2 (no space to run compilers) Java HotSpot(TM) 64-Bit Server VM warning: Shutting down compiler C1 (no space to run compilers) Overflow at depth: 20848 /java/re/jdk/8/promoted/all/b114/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Java HotSpot(TM) 64-Bit Server VM warning: Shutting down compiler C2 (no space to run compilers) Java HotSpot(TM) 64-Bit Server VM warning: Shutting down compiler C1 (no space to run compilers) Overflow at depth: 20848 /java/re/jdk/8/promoted/all/b115/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 20848 /java/re/jdk/8/promoted/all/b116/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 20848 /java/re/jdk/8/promoted/all/b117/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 20848 /java/re/jdk/8/promoted/all/b118/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 20848 /java/re/jdk/8/promoted/all/b119/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 20848 /java/re/jdk/8/promoted/all/b120/binaries/solaris-x64/bin/java -Xss2M -Xint StackOverflow Overflow at depth: 20848
24-06-2014

We're talking about Solaris here: $ /java/re/jdk/8/promoted/all/b109/binaries/solaris-x64/bin/java -Xint -Xss2M StackOverflow Final Level 46991 for JDK 1.8.0-ea $ /java/re/jdk/8/promoted/all/b110/binaries/solaris-x64/bin/java -Xint -Xss2M StackOverflow Final Level 22743 for JDK 1.8.0-ea It seems on Linux we always had the same behavior: $ /java/re/jdk/8/promoted/all/b109/binaries/linux-x64/bin/java -Xint -Xss2M StackOverflow Final Level 22739 for JDK 1.8.0-ea $ /java/re/jdk/8/promoted/all/b110/binaries/linux-x64/bin/java -Xint -Xss2M StackOverflow Final Level 22739 for JDK 1.8.0-ea
23-06-2014

On Linux x64: jdk8-b101 with -Xint: 22739 jdk8-b132 with -Xint: 22739 giving this to the compiler team
19-06-2014

Here's some interesting data from Solaris x64: /java/re/jdk/8/promoted/all/b109/binaries/solaris-x64/bin/java -Xss2M StackOverflow Overflow at depth: 43076 /java/re/jdk/8/promoted/all/b110/binaries/solaris-x64/bin/java -Xss2M StackOverflow Overflow at depth: 59759 /java/re/jdk/8/promoted/all/b111/binaries/solaris-x64/bin/java -Xss2M StackOverflow Overflow at depth: 20848 ... /java/re/jdk/8/promoted/all/b115/binaries/solaris-x64/bin/java -Xss2M StackOverflow Overflow at depth: 60147 /java/re/jdk/8/promoted/all/b116/binaries/solaris-x64/bin/java -Xss2M StackOverflow Overflow at depth: 20848 There was a large _reduction_ in frame size in b110 followed by a large _increase_ in b111, with a similar fall/rise at b115 and b116
19-06-2014