Last active
February 3, 2020 09:52
-
-
Save zhuyifan2013/72c27880203f0993cecb6b1cb35d067d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* VM options: -Xss128k | |
*/ | |
public class StackOF { | |
private static int stackCount = 0; | |
private static void callMyMethod() { | |
stackCount++; | |
callMyMethod(); | |
} | |
public static void main(String[] args) throws Throwable{ | |
try { | |
callMyMethod(); | |
} catch (Throwable e) { | |
System.out.println(stackCount); | |
throw e; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment