I try to get the memory usage of a process started via Java.
Can someone give me a hint how to do it for the example Notepad.exe?
// Memoryusage of the Java programm
Runtime runtime=Runtime.getRuntime();
total = runtime.totalMemory();
System.out.println("System Memory: " + total);
ProcessBuilder builder = new ProcessBuilder("notepad.exe");
Process p = builder.start();
Thanks for your help!
This question here including
ProcessBuilder pb = new ProcessBuilder("cmd.exe", "/C", "tasklist /fi \"IMAGENAME eq notepad.exe\" /NH");
solved my problem.