aspose file tools*
The moose likes Tomcat and the fly likes Severe: Memory leak. I am getting this error. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Severe: Memory leak. I am getting this error." Watch "Severe: Memory leak. I am getting this error." New topic
Author

Severe: Memory leak. I am getting this error.

chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806

Hi everybody, I am Chaitanya, I am using Tomcat 6.0 with eclipse sdk. Whenever I import classes into the classes folder I am this link of error.

Is there any bug in my coding?

I am using connection pooling with type 4 java database connectivity.

Thank you all in advance.


Love all, trust a few, do wrong to none.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16141
    
  21

Yes, this counts as a bug, although not necessarily a bad bug.

You have a process that's creating a thread but you didn't supply a way to tell that thread to terminate itself when a server shutdown request is made. This used to hang the server shutdown, since all threads have to be terminated before the JVM can halt. Apparently recent versions of Tomcat are good at detecting hanging threads and terminating them by brute force.

Just a reminder: it is a violation of the J2EE standard for an HTTP request processor to spawn threads. If you need to spawn a thread, it should be done via a request to some sort of non-http thread management process. You can set one of these up in a servlet init() method.


Customer surveys are for companies who didn't pay proper attention to begin with.
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806

Hi Mr. Tim, thanks for the reply, actually I am worried a lot.

Coming to the point, I am using Tomcat 6.0, which is a recent version. However Tomcat 7.0 has also been released, but I am using eclipse, it supports up to tomcat 6.0. So now I cant switch to Tomcat 7.0. However while deploying, I ll choose 7.0.

One more thing, you said that, the thread is not allowing the server to shut down, I am not getting the error while shutting down, When I import classes in to the classes folder while developing, I am getting this error.

One more thing, I did not understand the second para. Please can you explain me?

Thank you in advance. Have a good day.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16141
    
  21

Bad choice of words, actually. The server shutting down isn't really the problem. You get the problem when the webapp shuts down. It's just that my most common way of shutting down a webapp is by stopping the server.

When you update classes, Tomcat is re-deploying the webapp, which means that it stops and restarts the webapp. So that's why you'd see problems related to webapp shutdown at that time.

The actual reason why you get this message is because either application code is creating a thread named "File Reaper", or it's using a library that creates a thread named "File Reaper". You need to terminate that thread as part of your webapp shutdown process.
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806

Thank you Mr. Tim, how can I do that?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Severe: Memory leak. I am getting this error.