Java limiting resource usage

前端 未结 3 788
借酒劲吻你
借酒劲吻你 2021-02-19 04:48

Is there a way to limit both the number of cores that java uses?

And in that same vein, is it possible to limit how much of that core is being used?

3条回答
  •  太阳男子
    2021-02-19 05:41

    I don't think that there are built-in JVM options to do these kind of tweaks, however you can limit CPU usage by setting priority and/or CPU affinity of the JVM process. If you are on Linux take a look at CPULimit that is an awesome tool to do these kind of resource limitations.

提交回复
热议问题