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

Fix memory leak with CglibAopProxy$ProxyCallbackFilter #28888

Closed
wants to merge 2 commits into from

Conversation

vikeychen
Copy link
Contributor

Bug report

Bug report and reason is explained very well here #26266.

In the cglib side, this issue #80 is the consequence of trying to solve CallbackFilter leak.
As vlsi said

"weakly reachable CallbackFilters" and "classloader reuse" do not play together well.

Solution

  • This solution is to try to reduce the leak by make advisors and advisorChainFactory WeakReference , so that there should have no chance to leak 'big object'. Think about class created by cglib is also 'leaked', I think that should be acceptable.

  • Another quick solution is to make AbstractAutoProxyCreator implements DisposableBean, clear CallbackFilter field in generated class.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 29, 2022
@rstoyanchev rstoyanchev added the in: core Issues in core modules (aop, beans, core, context, expression) label Feb 9, 2023
@snicoll snicoll requested a review from jhoeller September 8, 2023 10:13
@snicoll
Copy link
Member

snicoll commented Sep 15, 2023

Thanks for the PR and sorry it got overlooked but #26266 has been fixed in the meantime. Please give it a try if you can.

@snicoll snicoll closed this Sep 15, 2023
@snicoll snicoll added status: superseded An issue that has been superseded by another and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: superseded An issue that has been superseded by another
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants