I have a Java program running on a linux system, which I would like to give a higher IO Scheduler priority. Is there a library JNI/JNA based that would allow me to do that from within my code?
views:
42answers:
2
                
                A: 
                
                
              You could spawn and external command and call ionice on your process.
                  Romain Hippeau
                   2010-08-07 17:26:58
                
              That's close to what I am probably going to do - capture pid at start up and call ionice from the same script I use to launch the app.
                  Michael Barker
                   2010-08-07 17:44:50
                
                
                A: 
                
                
              
            You can get the PID of the Java Process by using the Java Management API, at least when using the Sun JVM. Have a look at the actual implementations of the management objects, one returns the pid (don't know which for the moment).
Then I would use jnative to call the linux function, so you don't have to rely on ionice to be installed.
                  Daniel
                   2010-10-29 05:48:15