Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: More details on PermGen leaks

...

Anchor
Q2
Q2
Why does the memory usage increase when I redeploy a web application?

That is because your web application has a memory leak.

A common issue are "PermGen" memory leaks. They happen because Because the Classloader (and the Class objects it loaded) cannot be recycled unless some requirements are met (*). They are stored in the permanent heap generation by the JVM, and when you redeploy a new class loader is created, which loads another copy of all these classes. This can cause OufOfMemoryErrors eventually.

(*) The requirement is that all classes loaded by this classloader should be able to be gc'ed at the same time.

Starting with Tomcat 6.0.25 there is a tool in the Manager webapp to help diagnose such misbehaving applications. See FAQ/Memory and MemoryLeakProtection.

...

CategoryFAQ