I have written the code to get the size of the stack of my computer.
public class TestStack {
private static int c;
public static void main(String... args){
try{
f();
} catch (StackOverflowError e){
System.out.println(c);
}
}
private static void f(){
c ++;
f();
}
}
The result of its work is: 11908
What sets the size of the stack (JVM, OS or something else)? Is it possible to change the stack size?