tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Tomcat dies suddenly
Date Thu, 04 Feb 2010 22:32:35 GMT
Hash: SHA1


On 2/3/2010 11:46 PM, Mark Eggers wrote:
> From the taroon-list: If you're running a 32 bit Linux and run out of
> low memory, it doesn't matter how much high memory you have, the OOM
> killer will start killing processes off. Since you're running a 64
> bit Linux, this should not be the problem.

I'm not sure what "low memory" space you're talking about. I don't
believe Linux segments memory in any particular way.

> A discussion on may be more relevant to your
> situation. It turns out (according to the discussion) that calling
> Runtime.getRuntime().exec() on a busy system can lead to transient
> memory shortages which trigger the OOM killer.

There is a kernel (ha) of truth to this: *NIX "exec" is implemented as
fork() and then exec(), with the former being a "clone this process"
call and the latter being a "replace this process with a new one" call.
The fork() then duplicates the currently-running process (the JVM) which
requires double the memory, and could cause OOM if you have a JVM memory
footprint that was close to the logical memory limit that the kernel has

...except that Linux, specifically, and I would imagine *NIX in general,
implements copy-on-write behavior for fork()d processes. That means that
calling fork() on a running JVM doesn't eat up that much memory. This is
done intentionally because fork() is almost always followed by exec(),
where a duplicate of the old process in total would be a big waste of time.

Finally, the Linux OOM Killer is likely to choose the /new/ process to
murder, since it has been the shortest-running of the two (see On the other hand, if the JVM is doing
a /lot/ of Runtime.exec() calls, it's "badness" might be calculated to
be quite high, and therefore the process dies.

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message