How to get Runtime and PID with a process? In my application I start the Process with ProcessBuilder like this:
ProcessBuilder processBuilder = new ProcessBuilder(rgumentsList).toArray(new String[argumentsList.size()]));
processBuilder.redirectErrorStream(true);
processBuilder.directory(getInstanceMainDir());
instanceProcess = processBuilder.start();
How do I get instanceProcess
's Runtime and PID? I need Runtime to check the memory used by this app and PID to check used CPU.