Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add category link at the bottom of the page

...

  1. You'll need a profiler (I use YourKit), Tomcat and a copy of the app that leaks.
  2. Configure Tomcat for use with the profiler. This usually means setting / adding to PATH and CATALINA_OPTS in setenv.(bat|sh)
  3. Start Tomcat with the app deployed.
  4. Reload the app once.
  5. Start up the profiler and connected it to Tomcat.
  6. Get a heap dump.
  7. Look for instances of WebappClassLoader. If there are more instances than you have apps deployed, you have a leak.
  8. If there is a leak, there should be one extra instance of WebappClassLoader.
  9. Examine each of the WebappClassLoader objects in turn to find the one where started==false.
  10. Trace the GC roots of this object to find out what is holding on to a reference to that object that shouldn't be. That will be the source of the leak.

...

CategoryFAQ