Skip to content

java.lang.OutOfMemoryError: Metaspace when repeatedly deploying and undeploying a Spring Boot web application multiple times in Tomcat #37096

@vazhaa72

Description

@vazhaa72

When repeatedly deploying and undeploying a Spring Boot version 3.1.2 web application (WAR file) in a Tomcat application server one gets java.lang.OutOfMemoryError: Metaspace after 7-8 attempts.

This seems to be caused by the change in org.springframework.boot.SpringApplicationShutdownHook class, which now also registers org.springframework.boot.SpringApplicationShutdownHook.Handlers as a shut-down hook, which was not the case with Spring Boot 2.7 for example.

Metadata

Metadata

Assignees

Labels

type: regressionA regression from a previous release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions