If I run a recursive (Java) program on my machine, stack overflow usually occures before reaching depth of 10000 (there is no tail recursion since Java does not make it available unfortunately). Yet on Codeforces my recursive programs on trees work up to 100000 or more (one such program I found is https://mirror.codeforces.com/contest/1406/submission/92624199). Does anyone have an idea why is it like this and how can I make it so this would also work on my machine or on other less advanced online judges?