Why does Tomcat7 keep stopping by itself?

Linode Staff

Lately I’ve been experiencing a repeated issue where Tomcat7 stops services all by itself. To fix this I SSH into my server manually and start the services again.

How can I prevent this from happening in the first place, and how can I know the cause of it? I need this service to keep running.

1 Reply

A common cause for this would be if your system is running out of memory or experiencing “OOM”. I’d recommend checking your dmesg logs to confirm if this is the culprit.

You would see something like this toward the end, if so:

Out of memory: Kill process 31140 (java) scod
Killed process 31140 (java) total-vm:2737168kB, anon-rss:307360B
Out of memory: Kill process 22314 (java) score 578 or sacrificed
Killed process 22314 (java) total-vm:2712068kB, anon-rss:584508B
Out of memory: Kill process 16381 (freshclam) score 352 or sacrd
Killed process 16381 (freshclam) total-vm:846372kB, anon-rss:53B

You could also check on your available memory with the following command:

free -m

Running this command will show you a list of processes sorted by memory usage:

ps -eo pmem,pcpu,rss,vsize,args | sort -k 1 -r | less

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct