We are using Red Hat Enterprise Linux Server 7.4 (Maipo) and tomcat 8.5.30 . While accessing website the process count is increasing for java process rapidly and it reaches up to the extend where the max user processes limit crossed and we are getting fork: Resource temporarily unavailable error enter image description here

another issue is increased process count is not decreasing with time and it is constantly increasing. Below is systemd service file for tomcat

# Systemd unit file for tomcat
Description=Apache Tomcat Web Application Container
After=syslog.target network.target


Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Dconnector.ip= -Dconnector.port=901'

ExecStop=/bin/kill -15 $MAINPID


  • This isn't an answer to your question, but I would change ExecStop=/bin/kill -15 $MAINPID to ExecStop=/u01/tomcat/bin/shutdown.sh – Mark Stewart Jun 7 '18 at 14:46

Looks like the payload code of your Tomcat server might have a thread leak.

A thread leak is a type of resource leak: if references to thread objects are not properly released, old execution threads may not get garbage collected.

You (or your application developer) should also make sure that all exceptions are properly handled and any resources used in a temporary thread (connections, files, etc.) are properly released before the thread is closed, to avoid thread leaks.

Sending a SIGQUIT signal to the java process will cause it to generate a thread dump to standard output: a full listing of all its execution threads and what each thread is currently doing. Providing a thread dump to the application developer should help the developer identify which threads are not getting cleaned up properly, and hopefully fix the root cause.


Here {curly braces} in pstree output indicate child threads, as opposed to a multitude of identically-named child processes.

| improve this answer | |
  • 1
    i m able to find out root problem .i have integrated elastic search and while querying from elastic search i was not closing the client connection after closing connection the problem get resolved – Abdul Qadir Jun 28 '18 at 9:57
  • That makes sense. Good catch! – telcoM Jun 28 '18 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.