Hi all,
 
Can you tell me the impact of using following commands in a java program in
tomcat? 
Will they take more memory?
Will they take time to release memory?
Is there any other way we can call? to find best way
print statments on the child perl will affect the parent tomcat?
 
Invoking perl programs like the following ways:
 
1) Process process = new ProcessBuilder(params).start();
 process.waitFor();
 
2) Runtime.getRuntime().exec(command+" &");
 
3) RunCommand runcmd = new RunCommand(cmd);
runcmd.start();
 
----------------------------------------------------------------------------
---------------------------------------------------------
 
For Example
 
public class RunCommand extends Thread {

private final Logger logger=Logger.getLogger(RunCommand.class);

private String commandStr = null;

public RunCommand (String commandStr) {

this.commandStr = commandStr;

}

public void run() {

try {

Process p = Runtime.getRuntime().exec(commandStr);

int exitVal = p.waitFor();

if (p.exitValue() != 0 ) {

logger.warn("CFG Extraction Exited abnormally" + commandStr);

}

} catch (Exception e) {

logger.warn(e.getMessage());

}

}

public String getCommandStr() {

return commandStr;

}

public void setCommandStr(String commandStr) {

this.commandStr = commandStr;

}

}

Reply via email to