tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Service killed by signal 9
Date Fri, 10 Nov 2017 14:51:14 GMT
Hash: SHA256


On 11/10/17 8:46 AM, Konstantin Kolinko wrote:
> 2017-11-10 12:31 GMT+03:00 Greg Huber <>:
>> Since switching to jsvc, randomly I am getting tomcat restarting,
>> looking at the logs I see that the jsvc is using alot of memory
>> total-vm:  and being killed by the system.
>> Nov  9 13:11:11 prodbox kernel: Out of memory: Kill process 1287
>> (jsvc) score 121 or sacrifice child Nov  9 13:11:11 prodbox
>> kernel: Killed process 1287 (jsvc) total-vm:3453120kB,
>> anon-rss:378280kB, file-rss:0kB, shmem-rss:0kB
>> I am using the below on properties on the startup (from previous
>> version statup scripts):
>> -Xms256M -Xmx768m -Xss1280k -XX:+UseParallelGC
>> -XX:MaxGCPauseMillis=1500 -XX:GCTimeRatio=9 -server
>> -XX:+DisableExplicitGC
>> (I replaced -Xss256k with -Xss1280k to stop crashing see 
> The links in that issue go to a thread that explains that the issue
> is actually caused a kernel bug. It was reported & diagnosed in
> June 2017, thus should it have already been fixed?
> 1,2 Mb of stack for each thread mean that for 200 threads you will 
> need 240 Mb of memory just for thread stacks.  Most of that is
> wasted memory: You do not need to increase -Xss unless you are
> hitting StackOverflowError.
>> Is there a way to limit the total-vm or find out why its got so
>> big? -XX:+DisableExplicitGC ??
>> Standard tomcat install with apache/modjk.
> In Tomcat Manager web application there is "Server Status" page.
> It has a table that shows current memory consumption, as reported
> by Java.  The values can also be queried via JMX (e.g. with
> jconsole application).

Linux oom will use the actual process's used memory to compute its
killability, so the Java-reported memory usage won't tell the whole stor

Greg, how much total memory does the server actually have? Do you have
other services running on it as well? If you run low on memory, Linux
will simply kill your process. There are ways to minimize the
likelihood that your process will be killed, but if it's the only way
to free-up memory that the kernel is convinced it needs, well, then
your process is simply going to die.

One way to reduce your memory usage would be to reduce the heap size
you are using. Do you need that much heap? It's also possible that you
have a native memory leak somewhere, possibly caused by code outside
of your control. Do you have any native components involved that don't
ship with the JVM (or jsvc)? I'm unaware of any memory issues with
jsvc, but I'm not super familiar with it.

- -chris
Comment: GPGTools -
Comment: Using GnuPG with Thunderbird -


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

View raw message