Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8577453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:09:49+00:00 2026-06-11T20:09:49+00:00

I have a linux (ubuntu) server running tomcat7. The server has 1GB of ram,

  • 0

I have a linux (ubuntu) server running tomcat7. The server has 1GB of ram, and I am getting heap space errors thrown from java.

Basically what is happening, is that my tomcat server (running my servlet code) is throwing exceptions because there is no more memory to allocate. My code is pretty lean, so I don’t think that is the problem.

When I look at htop, I see a lot of java logging processes, I see about 30 of these processes:

ps ax | grep java
 7412 pts/0    Sl     0:02 /usr/bin/java -Djava.util.logging.config.file=/usr/share/tomcat/apache-tomcat-7.0.29/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/share/tomcat/apache-tomcat-7.0.29/endorsed -classpath /usr/share/tomcat/apache-tomcat-7.0.29/bin/bootstrap.jar:/usr/share/tomcat/apache-tomcat-7.0.29/bin/tomcat-juli.jar -Dcatalina.base=/usr/share/tomcat/apache-tomcat-7.0.29 -Dcatalina.home=/usr/share/tomcat/apache-tomcat-7.0.29 -Djava.io.tmpdir=/usr/share/tomcat/apache-tomcat-7.0.29/temp org.apache.catalina.startup.Bootstrap start
 7426 pts/0    D+     0:00 grep --color=auto java
25937 ?        Sl    13:12 /usr/bin/java -Djava.util.logging.config.file=/usr/share/tomcat/apache-tomcat-7.0.29/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/share/tomcat/apache-tomcat-7.0.29/endorsed -classpath /usr/share/tomcat/apache-tomcat-7.0.29/bin/bootstrap.jar:/usr/share/tomcat/apache-tomcat-7.0.29/bin/tomcat-juli.jar -Dcatalina.base=/usr/share/tomcat/apache-tomcat-7.0.29 -Dcatalina.home=/usr/share/tomcat/apache-tomcat-7.0.29 -Djava.io.tmpdir=/usr/share/tomcat/apache-tomcat-7.0.29/temp org.apache.catalina.startup.Bootstrap start

These java processes slowly leaks memory over time, and because I only have 1gb of ram to play with my tomcat server starts throwing heap space exceptions.

I have fiddled with log4j (but it should be turned off) and I have done all I can to turn off logging in configs I can find.

Any help would be great, I just need to get rid of these processes – they are way to greedy. Thanks!

~ Dan

EDIT: MORE INFO:

This is probably a big enough hint to solve this one entirely – I checked some of the startup debug and came up with this:

    Oct 02, 2012 8:50:08 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads

SEVERE: The web application [/NMVServer] appears to have started a thread named [http-bio-8080-exec-53] but has failed to stop it. This is very likely to create a memory leak.
Oct 02, 2012 8:50:08 AM org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads

SEVERE: The web application [/NMVServer] appears to have started a thread named [http-bio-8080-exec-54] but has failed to stop it. This is very likely to create a memory leak.
Oct 02, 2012 8:50:08 AM org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads

SEVERE: The web application [/NMVServer] appears to have started a thread named [http-bio-8080-exec-62] but has failed to stop it. This is very likely to create a memory leak.
Oct 02, 2012 8:50:08 AM org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads

SEVERE: The web application [/NMVServer] appears to have started a thread named [http-bio-8080-exec-64] but has failed to stop it. This is very likely to create a memory leak.

One problem with leaks that I found is due to a bug with the JDBC Driver http://bugs.mysql.com/bug.php?id=36565 according to a couple of forums. That solves another message I was getting.

I have been looking around and I have found this which is quite useful:

http://wiki.apache.org/tomcat/MemoryLeakProtection

Now I am just trying to work through all your advise thanks heaps!

~ Dan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:09:50+00:00Added an answer on June 11, 2026 at 8:09 pm

    I general I would expect the logging code in java to have been well tested. If there is no log output being generated by your logging config it has a low overhead. Your htop results are probably showing some idle thread status in tomcat.

    It could be logging but you may want to consider all the ways your application or another component may be leaking memory.

    All JVM’s have pretty good tools for diagnosing memory leaks. Threads like this discuss great ways to find out what is going on.

    Edit: some more thoughts

    You might want to check your configuration for too many sessions if a lot of requests are using HttpServletRequest.getSession(). The Manager component config goes inside Context and defaults to -1 for unlimited sessions.

    Check your version of tomcat with the current issue fix list in case you are encountering a known memory leak.

    Lastly, Tomcat 7 includes a JreMemoryLeakPreventionListener that might show resources not being released.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a server from AWS EC2 service running on Linux ubuntu and I
I have a server that is running Ubuntu Linux Server Edition. I once had
I have a linux server running ubuntu 10.10 maverick with apache and php installed,
We have a MySQL database running on a Linux (Ubuntu) server. We are thinking
I have a running (in production) mysql instance on my linux server (ubuntu-10.10) however
I bought a domain name with GoDaddy.com. I have a Ubuntu linux server running
I have a shell account on a Linux server (running Ubuntu 8.04) with user
I have a Subversion repository (running SVN 1.6.6) on an Ubuntu Linux server, and
I have fresh installation of RabbitMQ on a linux/ubuntu server. Lets say the server
I have written a server daemon (Linux, Ubuntu) which communicates with PHP as frontend

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.