Skip to content

Instantly share code, notes, and snippets.

@zhuyifan2013
Last active February 3, 2020 09:52
Show Gist options
  • Save zhuyifan2013/72c27880203f0993cecb6b1cb35d067d to your computer and use it in GitHub Desktop.
Save zhuyifan2013/72c27880203f0993cecb6b1cb35d067d to your computer and use it in GitHub Desktop.
/**
* 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