How deep do I need to go into the call stack before I get a StackOverflowError? Is the answer platform dependent?
The call f(5) creates a call stack with a maximum depth of 5. It is possible that the call f(10) would create a deeper call stack.
The Java stack size is the size limit of each Java thread in the Java Virtual Machine (JVM) that runs the monitoring Model Repository Service. The default value is 512K. You can increase this property to make more memory available to monitoring Model Repository Service processes.
The call stack is what a program uses to keep track of method calls. The call stack is made up of stack frames—one for each method call. For instance, say we called a method that rolled two dice and printed the sum.
Java does not effectively handle the stack space for recursive type functions. The default value for the stack size in the JVM is 1024K. Therefore, you must increase the stack size for the JVM to 4M depending on the recursive logic defined in the workflow.
It depends on the amount of virtual memory allocated to the stack.
http://www.odi.ch/weblog/posting.php?posting=411
You can tune this with the -Xss
VM parameter or with the Thread(ThreadGroup, Runnable, String, long)
constructor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With