I want my Java program to lower it's priority some so it doesn't overwhelm the system. My initial thought was to use Thread.currentThread().setPriority(5)
but that appears to be merely its priority within the JVM.
Then I thought maybe I'd cludge it and invoke a system command, but Thread.getId()
is also merely the JVM's id, so I don't even know what process id to pass to renice
.
Is there any way for a Java program to do something like this?