Skip to content

AbstractApplicationEventMulticaster can leak classes [SPR-11606] #16229

Closed
@spring-projects-issues

Description

@spring-projects-issues

Eric Bottard opened SPR-11606 and commented

This was discovered as part of the PR mentioned above, in the context of XD.

Basically, we create app contexts which have their own classloaders and can come and go. Those contexts (modules in XD terms) have a parent context that lives longer.
If event listeners are installed in the child context, listening for an event type that is loaded by the custom classloader, the parent context will still retain the types and hence the CL long after the child context has been torn down, preventing proper GC.

This gist https://gist.github.com/ericbottard/ad6da5559257fbcb0325 shows the problem (albeit not using a dedicated classloader). Run it using like yourkit and see retention of the custom event type


Affects: 3.2.8, 4.0.2

Reference URL: spring-attic/spring-xd#669

Issue Links:

Backported to: 3.2.9

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions