I just want to control the stack size for all of my threads in a Java (groovy) application. For the Hotspot Oracle VM, I know that there are two parameters doing that (-Xss and
Current Oracle Java SE 8 docs suggest that -Xss
and -XX:ThreadStackSize=size
are equivalent. See
https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html
-Xss
:-Xsssize
Sets the thread stack size (in bytes). Append the
letter k or K to indicate KB, m or M to indicate MB, g or G to
indicate GB. The default value depends on the platform:
Linux/ARM (32-bit): 320 KB
Linux/i386 (32-bit): 320 KB
Linux/x64 (64-bit): 1024 KB
OS X (64-bit): 1024 KB
Oracle Solaris/i386 (32-bit): 320 KB
Oracle Solaris/x64 (64-bit): 1024 KB
The following examples set the thread stack size to 1024 KB in different units:
-Xss1m
-Xss1024k
-Xss1048576
This option is equivalent to -XX:ThreadStackSize.
-XX:ThreadStackSize=size
-XX:ThreadStackSize=size
Sets the thread stack size (in bytes). Append the
letter k or K to indicate kilobytes, m or M to indicate
megabytes, g or G to indicate gigabytes. The default
value depends on the platform:
Linux/ARM (32-bit): 320 KB
Linux/i386 (32-bit): 320 KB
Linux/x64 (64-bit): 1024 KB
OS X (64-bit): 1024 KB
Oracle Solaris/i386 (32-bit): 320 KB
Oracle Solaris/x64 (64-bit): 1024 KB
The following examples show how to set the thread stack size to 1024 KB in different units:
-XX:ThreadStackSize=1m
-XX:ThreadStackSize=1024k
-XX:ThreadStackSize=1048576
This option is equivalent to -Xss.