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

前端 未结 5 2142
我寻月下人不归
我寻月下人不归 2021-02-13 16:00

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

5条回答
  •  滥情空心
    2021-02-13 16:35

    -Xss works only on main Java thead, but -XX:ThreadStackSize works on all Java thread.

    If -Xss (or -ss) were passed on the command line, it gets picked up directly by the launcher and is used later to create the "main" Java thread, without asking the VM for the preferred thread stack size. That where inconsistency comes from: if -Xss is given after -XX:ThreadStackSize, then things are still good; otherwise, the "main" Java thread would have a stack size specified by -Xss where as other Java threads' stack size would still follow that of ThreadStackSize.

    Inconsistency between -Xss and -XX:ThreadStackSize in the java launcher

提交回复
热议问题