Update a java thread's stack size at runtime

前端 未结 2 1506
野趣味
野趣味 2021-01-13 15:24

Does anyone know if there is a way to dynamically (runtime) increase the stack size of the main Thread? Also, and I believe it is the same question, is it possible to increa

2条回答
  •  生来不讨喜
    2021-01-13 15:42

    There's not a way to do this in the standard JDK, and even the stackSize argument isn't set in stone:

    The effect of the stackSize parameter, if any, is highly platform dependent. ... On some platforms, the value of the stackSize parameter may have no effect whatsoever. ... The virtual machine is free to treat the stackSize parameter as a suggestion.

    (Emphasis in original.)

提交回复
热议问题