Skip to content

Memory leak when using @Async after upgrading from 5.1 to 5.2 #23571

@arian

Description

@arian

Affects: 5.2.0.RC1


In our application I upgraded from spring-framework 5.1.9 to 5.2.0.RC1 and our tests started leaking memory.

Previously it looked like this in VisualVM:

image

And now it looks like this:

image

I've made a heapdump to see where the memory is going:

image

I've seen something similar in our application previously, but that was solved by using @MockBean instead of a lot of @ContextConfiguration with @Configuration classes inside our test classes to override beans with mocked objects 🤔...

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: feedback-providedFeedback has been providedtype: regressionA bug that is also a regression

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions