Where can I find default -Xss (stack size) value for Sun/Oracle JVM?

charlie arehart picture charlie arehart · May 16, 2011 · Viewed 71.7k times · Source

Has anyone ever found a single JVM document listing default -Xss values for various versions of the Sun/Oracle JVM, and for different OS's?

I've been able to find this table in the jrockit jdk 5.0 docs, but that's not helpful for those using the "normal" Sun/Oracle JVM.

I do appreciate that the -Xss value will vary per OS (and JVM version), so maybe there is no one document that lists all recent combinations. But if any readers here know of any individual documents that list at least just the default -Xss value for each JVM version (or at least 1.6 and 1.5), or even if only for some OS's, that would be a great start.

I'll add that the reason this is valuable is that often we see people recommend (wrongly, I think) that someone can solve a problem by changing the -Xss value. But if you don't know your default, then there's no way to know if you're raising or lowering the value by whatever change someone recommends. They don't generally indicate the version/OS they're on, so it's a crapshoot whether their suggestion will "help" you.

Even better than some documentation, if anyone knows a way to query the JVM to get the current value, whether from the command line or via an API call, that would be even more valuable. Thanks.

Answer

plockc picture plockc · Dec 5, 2014

try:

java -XX:+PrintFlagsFinal -version | grep ThreadStackSize