Skip to content

OutOfMemory Exception when publishing User Events [SPR-13540] #18116

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Issue Links:

Referenced from: commits 427767f

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions