Jan Gosmann created GROOVY-12142:
------------------------------------

             Summary: Metaspace memory leak with parallel deployments on Tomcat
                 Key: GROOVY-12142
                 URL: https://issues.apache.org/jira/browse/GROOVY-12142
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 4.0.29, 4.0.24
         Environment: Tomcat: 10.1.55

openjdk version "17.0.19" 2026-04-21 LTS
OpenJDK Runtime Environment (Red_Hat-17.0.19.0.10-1) (build 17.0.19+10-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.19.0.10-1) (build 17.0.19+10-LTS, mixed 
mode, sharing)
            Reporter: Jan Gosmann
         Attachments: Screenshot 2026-07-09 at 09.46.46.png, spring-test.tar.gz

We are using [Tomcat parallel 
deployments|https://tomcat.apache.org/tomcat-10.0-doc/config/context.html#Parallel_deployment]
 to achieve downtimeless deployments. However, we with each new deployment the 
metaspace grows (see attached image). Even after undeploying the old version it 
does not shrink. If we configure a maximum metaspace size, new parallel 
deployments fail with an out-of-memory error.

I was able to reproduce this with a very simple Spring Boot application 
(attached). As long as I had no Groovy in there, metaspace was reclaimed before 
hitting the maximum on new deploys. After introducing Groovy, metaspace is no 
longer reclaimed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to