Is there a way to put maximum memory usage limit on each thread in Java?

后端 未结 4 907
遇见更好的自我
遇见更好的自我 2021-01-18 13:38

When we start threads in a Java program, is there any way for us to assign memory limit to each one of them?

I mean we assign something like this for a

4条回答
  •  无人共我
    2021-01-18 14:19

    You can increase thread stack size with -Xss. It will apply to every thread. Heap is shared so you can´t change it for threads separatelly.

提交回复
热议问题