Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

stack

jvm

size

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

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

I do appreciate that the -Xss value will vary per OS (and JVM version), so maybe there's 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'm especially interested in the default for Windows.

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.

Update: I have added an answer of my own that summarizes the various suggestions and points to a current resource (in early 2021) indicating the answer, including what I learned about the -Xss value in Windows.

like image 971
charlie arehart Avatar asked May 16 '11 16:05

charlie arehart


People also ask

What is the default size of JVM?

The Java™ virtual machine (JVM) heap size setting directly relates to how many server instances can be started within a dynamic cluster on a specific node. You might need to modify the JVM heap size setting based on your environment configuration. The default value is 256 MB.

How do I know my JVM heap size?

You can verify that the JVM is using the increased Java heap space: Open a terminal window. Review the command output. The argument beginning with "-Xmx" will give you the value of the current Java heap space.

What is the default XMX Java value?

The flag Xmx specifies the maximum memory allocation pool for a Java virtual machine (JVM), while Xms specifies the initial memory allocation pool. The Xms flag has no default value, and Xmx typically has a default value of 256 MB.


1 Answers

try:

java -XX:+PrintFlagsFinal -version | grep ThreadStackSize 
like image 138
plockc Avatar answered Oct 17 '22 05:10

plockc