Hi all,
I am currently developing a
servlet to be integrated with a third-party application. At one point, my servlet instantiates a class that calls an external application using Runtime.exec(). Then it calls Process.waitFor() to wait for the external process to complete.
For large input files, this external process can take as much as ten minutes to run. During that time, the entire web application becomes unresponsive, even the parts that have nothing to do with my servlet. The web application slows to a crawl until the external process completes and waitFor() returns. I am trying to determine the reason for this behavior.
While it is possible that the delay is caused by the external process using too much memory and/or CPU time, I just want to know if it is generally a bad idea to call Process.waitFor() from a servlet (or from another class that is instantiated by the servlet). Will that in itself cause the entire web application to hang? Note that the external process being called is a native application, not a
Java app.
Thanks in advance, any and all help is greatly appreciated.