+ 2

How big is a stack?

I got stackoverflow error. What is the limit for this? (Will it happen same on all devices? Device independence?) No recursion but recurring user input got me this.(java✌)

7th Apr 2018, 10:54 AM
Rifat
Rifat - avatar
1 Resposta
+ 2
It depends on JVM version - here you can see - default stack size of different JVM version - https://docs.oracle.com/cd/E13150_01/jrockit_jvm/jrockit/jrdocs/refman/optionX.html#wp1024112 . You also can increase stack size if you want, but you need to change settings of jvm - "java -Xss16M" - write this in your console if you want to increase stack size to 16mb. Of course you cannot do this in sololearn platform.
7th Apr 2018, 11:19 AM
Vladi Petrov
Vladi Petrov - avatar