Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Tomcat 7 improve the Classloader leak situation from Tomcat 6?

Tomcat is famous for the classloader leak that occurs on repeated redeployments of an app. They seem to usually be centered around the logger class. Repeated redeployments end up causing Perm Gen errors.

I know this tends to be a big problem in Tomcat 6. Is it any better in Tomcat 7?

On a side note, does anyone have any good resources for handling classloader leaks. Is the situation any better with other servers?

like image 953
Joe Avatar asked Mar 20 '12 19:03

Joe


1 Answers

Well, this isn't really caused by Tomcat but rather by applications using ThreadLocals, failing to deregister JDBC drivers or stopping custom threads, etc. Tomcat 6 introduced some memory leak detection mechanism, Tomcat 7 improved it significantly: MemoryLeakProtection.

With regards to loggers leaking, have a look at very comprehensive Taxonomy of class loader problems encountered when using Jakarta Commons Logging.

like image 173
Tomasz Nurkiewicz Avatar answered Sep 21 '22 15:09

Tomasz Nurkiewicz