AbstractApplicationEventMulticaster can leak classes [SPR-11606] #16229
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
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
The text was updated successfully, but these errors were encountered: