Tomcat memory leak

I found this to be a well known Tomcat issue so I am trying to solve it on my server.

Deploying / deploying military files on my Tomcat I often get this warning while checking for memory leaks:

The following web applications were stopped (reloaded, undeployed), but their
classes from previous runs are still loaded in memory, thus causing a memory
leak (use a profiler to confirm):
/GEKKO
/GEKKO
/GEKKO
/LinkPlatform

      

This StackOverflow answer suggests:

Make sure your web application is not using java classes that are in the shared libraries of the web container. If you have shared libraries, make sure there are no strong object references in those libraries.

What does it mean? I am using Maven in my Eclipse project and all dependencies are automatically downloaded. But I need to manually add Tomcat libraries to the build path of the project (Runtime Server). This is problem? Are Tomcat jars "shared libraries"?

+3


source to share


1 answer


The boxes provided by Tomcat at runtime should be constrained as provided

if you need to compile them, but expect the Tomcat container to provide them at runtime, eg.

  <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.0.1</version>
      <scope>provided</scope>
  </dependency>

      



(version is what I threw in there ... use whatever fits).

+3


source







All Articles