Say, \"run myApp.jar with cpu=800 and memory=1024\"
Ive been doing java programming for many years and it is an embarrasment to ask this question. I don\'t even know
Linux:
taskset -a -c 0,1,2,3 <program>
Run a program and its child threads only on cores 0, 1, 2, and 3.
The JVM has no control over CPU usage nor priority.
JVM has control over max/min Memory usage.
There is a workaround. It is possible to run each JVM in a separate [Docker container][1]. And control the resource (Memory, CPU, Network, IO) allocation for each container. That is exactly the added value of the Docker containers.
[1]: The JVM has no control over CPU usage nor priority. Yet you can run each JVM in a separate Docker container. And control the resource allocation foreach container. That is exactly the added value of the Docker containers.