PDA

View Full Version : using exec call with Quercus


adam
02-29-2012, 07:49 PM
Hi,

I am using Quercus PHP to make some system calls, but I am worried about memory issues that are related to Java Runtime.exec() within Linux environments.

The following thread discusses the problem (http://stackoverflow.com/questions/2876964/java-runtime-getruntime-exec-alternatives), but the general idea is that Java runtime exec forks the process and (in some sense) requires as much memory as the parent process. If the parent process is a high memory application server, then this can be a high memory request (even if write-on-copy is used).

I see that you use the ProcessBuilder for your PHP exec, but will it still run into the above issues? (I imagine that it will because it is similar to Runtime.exec) I run Quercus on Tomcat (but I imagine it would be similar on other app servers as well).

Any help here will be great. Thanks.

nam
03-30-2012, 05:36 PM
Hi adam,

This is a JDK issue. You may want to try newer JDK versions as I believe they improved the way they forked processes.