I\'m writing a function that will call itself up to about 5000 times. Ofcourse, I get a StackOverflowError
. Is there any way that I can rewrite this code in a f
default stack size in java is 512kb. if you exceed that program will terminate throwing StackOverflowException
you can increase the stack size by passing a JVM argument : -Xss1024k
now stack size is 1024kb. you may give higher value based on your environment
I don't think we can programmatically change this