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