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

Scheduled/JmsListenerAnnotationBeanPostProcessor free heap space [SPR-15175] #19741

Closed
spring-issuemaster opened this issue Jan 22, 2017 · 0 comments

Comments

@spring-issuemaster
Copy link
Collaborator

commented Jan 22, 2017

Gary Russell opened SPR-15175 and commented

After fixing a similar problem to #16803 in Spring AMQP (AMQP-701), I took a look to see if the same problem exists in the JMS BPP and noticed there is already a fix there by caching nonAnnotatedClasses.

I believe this Set could be cleared in afterSingletonsInstantiated(), freeing up the heap space for these references. It would be at the cost of 1 extra parse for scoped beans that have already been referenced during context initialization.

I took a slightly difference approach in Spring AMQP, by caching the annotated methods and their annotations (with non-annotated classes getting an empty MultiValueMap method list), so I had rather more data after context initialization than just a reference to most bean classes; hence I clear the cache when complete.


Issue Links:

  • #16803 Scheduled/JmsListenerAnnotationBeanPostProcessor needlessly scans every scoped instance
  • AMQP-701 Bean creation slow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.