Closed
Description
Peter Rosendahl opened SPR-13540 and commented
We ran into an OutOfMemory Exception while stress testing our application, and it turned out that SimpleApplicationEventMulticaster retained 75% heap. From debugging the code it looks like the retrieverCache from AbstractApplicationEventMulticaster filled up with over 60,000 Elements. Each time our application publishes an ApplicationEvent it gets a different ListenerCacheKey and the map size grows by 1.
This only happens with Events which are not of type ApplicationEvent. See attached Unit Test to demonstrate the behaviour. Test "userEventTypeApplicationEventCaching" works and "userEventCaching" fails.
Affects: 4.2.1
Attachments:
- UserDefinedEventsTest.java (2.69 kB)
Issue Links:
- Spring incorrectly interprets a bean to be a spring eventlistener [SPR-13538] #18114 Spring incorrectly interprets a bean to be a spring eventlistener
- ResolvableType.getType() should reflect the set up type correctly [SPR-12701] #17298 ResolvableType.getType() should reflect the set up type correctly
- PayloadApplicationEvent can't hit cache [SPR-13543] #18119 PayloadApplicationEvent can't hit cache
Referenced from: commits 427767f