The Xss JVM Argument And What Does It Do?
There are a set of arguments listed in this previous blog post which I have found to be especially good in heaps og 32GB or less on 64-bit machines of course. One of those arguments has an Xss prefix and I use this to size the JVM thread stack size, from Java SE6 onward the default stck size on 32-bit is 320kb and on 64-bit, 1mb.
If I am applying this argument without the ability to load-test I will always try Xss256k and that is almost always fine. If that size is too small, we will get a "StackOverflowError" and that is another important point to note, anytime a Java stack has more data to contain than its maximum capacity you will get a "StackOverflowError".