We faced a metaspace leak problem in our JBoss EAP 7, and this leak occoured after every hot deployment.
After some search, I've found this: https://blog.voina.org/docker-jboss-dies-with-java-lang-outofmemoryerror-metaspace-after-several-redeploys/
It actually may be related to EHCache that save some class references and this prevent JBoss classloader from removing old classes from metaspace.
In this article the suggestion is to use the listener included in EHCache library:
net.sf.ehcache.constructs.web.ShutdownListener
Unfortunately we're using EHCache 3.2.0 and there is no such listener in that version, is there any alternative to that Listener? Or any method that does the exact same thing that I can call in "contextDestroyed" method?