Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spring-projects-issues opened this issue Oct 5, 2015 · 1 comment
Closed
Assignees
Labels
in: core type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Oct 5, 2015

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:

  • #18114 Spring incorrectly interprets a bean to be a spring eventlistener
  • #17298 ResolvableType.getType() should reflect the set up type correctly
  • #18119 PayloadApplicationEvent can't hit cache

Referenced from: commits 427767f

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 5, 2015

Juergen Hoeller commented

This turns out to be due to PayloadApplicationEvent's use of ResolvableType.forClassWithGenerics, which in turn exposes a SyntheticParameterizedType as of 4.2 (#17298)... and that one was missing an equals / hashCode implementation.

Fixed for 4.2.2 now, scheduled for release next week. Feel free to give the upcoming 4.2.2.BUILD-SNAPSHOT a try...

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core type: bug
Projects
None yet
Development

No branches or pull requests

2 participants