-
Notifications
You must be signed in to change notification settings - Fork 38.5k
ProxyFactory memory leak using cglib [SPR-3620] #8302
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
Comments
Andy Piper commented Memory reference picture |
Andy Piper commented I think that the bug is in ProxyCallbackFilter. cglib maintains a hard reference to this in the key and so the value doesn't go away. I suspect by making the fixedInterceptorMap and advised fields weak this may cure the problem. |
Juergen Hoeller commented This might be a general memory leak problem with CGLIB, I'm afraid. If we make Spring's fields weakly referenced there, the CGLIB class itself will probably still stay around in memory. Of course the leak would show less effect then... so that might already help. Juergen |
Andy Piper commented I'm not so sure. cglib correctly uses a WeakHashMap, with Spring fixed things might be ok. I'll attach the candidate fix that I am testing. |
Andy Piper commented Candidate fix |
Andy Piper commented This is confirmed to fix at least one leak. |
Andy Piper commented Updated patch. I found another leak. |
Juergen Hoeller commented I have fixed this in CVS HEAD (for 2.1 M3) and mbranch-2-0 (for 2.0.7). This should be available in the next 2.1 M3 as well as 2.0.7 snapshots (tonight / tomorrow). Juergen |
Juergen Hoeller commented Andy, could you please re-test a current 2.5 RC2 / 2.0.8 snapshot with respect to this leak? I had to revise Cglib2AopProxy again since the fixes that you suggested here unfortunately caused a side effect with the reuse of CGLIB proxy classes... (see #8684) Thanks in advance, Juergen |
Andy Piper opened SPR-3620 and commented
We are seeing a memory leak in ProxyFactory when using cglib. I will attach a picture of the references.
Affects: 2.0.5
Attachments:
Issue Links:
The text was updated successfully, but these errors were encountered: