Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Severe: Memory leak. I am getting this error.

 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18218
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18218
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Mr. Tim, how can I do that?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic