Description
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:
- Memory leak when using annotation based auto-wiring in child context [SPR-11520] #16145 Memory leak when using annotation based auto-wiring in child context
- Changes to AbstractApplicationEventMulticaster in 3.2.9 break HttpSessionEventPublisher in Google AppEngine Runtime [SPR-12002] #16618 Changes to AbstractApplicationEventMulticaster in 3.2.9 break HttpSessionEventPublisher in Google AppEngine Runtime
Backported to: 3.2.9