Description of the problem
I noticed that each deployment of one of our Java8 applications on Wildfly 8.2.1 uses approximately 30-40 MB from the memory pool in the metadata. This is good, but the fact is that as soon as I redistribute the same application, the use of Metaspace memory increases by the same 30-40 MB, while the old memory already allocated will not be released.
I would not even notice this, but the fact is that we have ~ 20 applications, and from time to time I need to redistribute up to 10 of them simultaneously. This, in turn, leads to a terrible picture.
It basically shows that two redeployments of ~ 10 applications.
I'm not sure why the GC cannot free the memory allocated for old classes. This server has a total of 16 GB of physical memory, so I can redeploy all applications up to 20-40 times, that's all. The application server will reach the limit and stop responding to any commands.
Therefore, I would be very grateful if someone would help me understand what could be an urgent problem:
- Is this a Java8 issue? (jdk 1.8.0_40-b26)
- Is this a Wildfly 8.2.1 problem?
- Or is it as simple as possible to answer that the reason is my code base? If so, then could you direct me, what could be the actual reason?
Additional information about my codebase
1) Together with Wildfly I use 2 stand-alone HornetQ servers, each application uses ~ 5 channels with at least 5 simultaneous consumers on each. This, in turn, results in at least 25 threads for each application and at least 25 * 20 = 500 threads.
2) For all low level JMS operations I use Spring JMS.
source share