I am running the code on Linux platform. However, I always got some errors. Here are the stack trace of them:
java.io.IOException: Cannot allocate memory java.io.IOException: java.io.IOException: Cannot allocate memory at java.lang.UNIXProcess.<init>(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:451) at java.lang.Runtime.exec(Runtime.java:591) at java.lang.Runtime.exec(Runtime.java:429) at java.lang.Runtime.exec(Runtime.java:326)
Anybody has any idea why is this happening? Thanks. Aulia
You can try using ssh library of java (like http://javassh.org/) to connect to the remote server and read the log file and process it. I don't think you can fork a process remotely otherwise.
No, I am locally executing the command. In addition to that, I cannot even execute something simple like "ls". I am also doing it in a tight loop, but each loop throws the exception.
The code looks like this:
Please let me know if anyone has ideas why such simple code like this throws the Exception. Thanks.