What is the difference between -Xss and -XX:ThreadStackSize?

-Xss is an alias for -XX:ThreadStackSize both for OpenJDK and Oracle JDK.

Though they parse arguments differently:
-Xss may accept a number with K, M or G suffix;
-XX:ThreadStackSize= expects an integer (without suffix) - the stack size in kilobytes.


-Xss is standard options recognized by the Java HotSpot VM.

-XX:ThreadStackSize as other -XX options are not stable and are subject to change without notice.

See Java HotSpot VM Options


UPDATED 2019 for Java SE 8

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


For -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.

For -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.