5

I'm currently investigating some out of meta space issues we've been experiencing recently. One of the main culprits seems to be the loading of duplicate classes upon redeployment of a WAR. Trying it out locally, with just one of our WARS, by heap dumping after undeploying completely, I can see that the majority of the instances created by the application are still there (even after garbage collection).

From the heap dump, I can see that it seems to be the ManagedThreadFactoryImpl that is holding onto references.

Is there anything I can do/add to the application shutdown process so it cleans up after itself?

All our WARs are spring applications, most use scheduling/asynchronous elements.

We're using JDK8 with Wildfly 8.2

Martin Cassidy
  • 686
  • 1
  • 9
  • 28

1 Answers1

0

Seems like the classloaders are not unloading. Try Java Mission Control (JMC) and record the use case. This lets you go to a specific point in time in your recording and debug the issue. It gives the snapshot of classes loaded at a specific time with stacktrace, threaddumps and a lot of important things.

JMC is included in JDK. You can find more info here: https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr002.html#BABIBBDE

You dont have to go through the pain of taking heap dumps and then wait for a tool to analyze it.

Nik
  • 211
  • 4
  • 16