If ManagedOfficeProcess.doTerminateProcess fails jodconverter stays in nonoperable state

62 views
Skip to first unread message

Zhivko

unread,
Jan 27, 2010, 10:30:51 AM1/27/10
to JODConverter
There is no error in logs if "ManagedOfficeProcess.doTerminateProcess"
fails to execute. If this happens jodconverter stays in nonoperable
state (Ubuntu 9.10).

In my case I had out of memory exception:

Exception in thread "OfficeProcessThread-0"
org.artofsolving.jodconverter.office.OfficeException: could not
terminate process
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.doTerminateProcess
(ManagedOfficeProcess.java:155)
at org.artofsolving.jodconverter.office.ManagedOfficeProcess.access$2
(ManagedOfficeProcess.java:150)
at org.artofsolving.jodconverter.office.ManagedOfficeProcess$4.run
(ManagedOfficeProcess.java:95)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: Cannot run program "/bin/kill":
java.io.IOException: error=12, Cannot allocate memory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
at org.artofsolving.jodconverter.process.UnixProcessManager.execute
(UnixProcessManager.java:65)
at org.artofsolving.jodconverter.process.UnixProcessManager.kill
(UnixProcessManager.java:61)
at
org.artofsolving.jodconverter.office.OfficeProcess.forciblyTerminate
(OfficeProcess.java:194)
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.doTerminateProcess
(ManagedOfficeProcess.java:152)
... 5 more

To ensure error will be at least logged I changed method to:

private void doTerminateProcess() {
try {
int exitCode = process.forciblyTerminate
(settings.getRetryInterval(), settings.getRetryTimeout());
logger.info("process forcibly terminated with code " +
exitCode);
} catch (Exception exception) {
logger.severe(exception.getMessage());
throw new OfficeException("could not terminate process",
exception);
}
}

Now - how I can resolve why out of memory happened?
Garbage collector is configured through environment variable:

export CATALINA_OPTS="-Xms512m -Xmx512m -Xloggc:/usr/local/tomcat/temp/
gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xincgc -
XX:PermSize=512m -XX:MaxPermSize=512m"

Can I check something else?

Mirko Nasato

unread,
Jan 27, 2010, 3:52:08 PM1/27/10
to JODConverter
It's not an OutOfMemoryError, it's an IOException, caused by "cannot
allocate memory". In other words, it's not the JVM memory, it's the OS
memory.

Kind regards

Mirko

Reply all
Reply to author
Forward
0 new messages