| || |
Process memory usage
I'm new and using RFT 8.0 for Java. My question is on querying running processes to get their memory usage. I would like to find out usage data in a WMI sort of fashion, but it doesn't seem like there is an easy way to access WMI using Java without downloading or buying libraries for it.
Is there any RFT classes and methods that can give me an equivalent of this? I read a post on how startApp returns the processID. I've used this and some DomainTestObject code to view the properties of my browser object. But the getProperties method doesn't seem to have a property for memory or CPU usage, just PID and ProcessName.
Thanks for the help
Re: Process memory usage
also in case you know what you are looking for in WMI, you might want to use java.lang.Runtime and java.lang.Process to write a *proxy* for the WMI output you need.
String cmd = "dir";
String runCmd = "";
runCmd = "cmd.exe /C " + cmd;
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(runCmd);
int return = proc.waitFor();
in case of an output stream greater then 17 lines you need to thread the output and error.
then in case you know your WMI command
yourWrapperClass.run("wmic process where (CommandLine=\"javaw\");
OR simply wrap you WMI command into a batch file to be called by above sample.
and parse the output you are looking, this obviously won't give you a reference to java.lang.Runtime to have capability to call memory related methods, but just the WMI sort of fashion [img]/images/graemlins/wink.gif[/img]
I never tried jawinproject but I would bet on it rather ! it depends what you is your interest.