Skip to content

OOM Metaspace while redeploying WAR application in WildFly #19385

@luStopai

Description

@luStopai

Hi

I think there's some problem with class unloading when deploying a spring boot application as war on a web server such as wildfly.

I had this issue where after some deployments I got OOM Metaspace error. In order to discard some bug in my code causing this problem I created a new spring boot project with https://start.spring.io/ and deployed it a few times getting an OOM Metaspace error again. So my guess is that there's something in springboot itself causing the problem.

Steps to reproduce:

  1. Go to https://start.spring.io/
  2. Change packaging from jar to war
  3. Add spring web dependency (not sure if it's a necessary step)
  4. Download wildfly
  5. Open the project and build the war file
  6. Deploy it to wildfly
  7. Redeploying the project will increase the amount of classes loaded, and the metaspace used until there's no free space left getting the OOM Metaspace error

Tip: If you run wildfly with -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m you'll reach OOM Metaspace error with about 10 redeployments. If you are wondering where did I get these numbers, I think this is the default configuration of https://hub.docker.com/r/jboss/wildfly/

I attached a screenshot of visualVM monitoring the redeployments where you can clearly see how metaspace increases after each redeploy

FYI: I don't know much about class loading/unloading, metaspace issues, etc. but this is the conclusion I reached after some research. If this is not the right place to report this issue feel free to close it. Anyway any help or orientation will be much appreciated

Thanks

Screenshot_20191216_235012

Metadata

Metadata

Assignees

Labels

status: invalidAn issue that we don't feel is valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions