-
Notifications
You must be signed in to change notification settings - Fork 5
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
Possible memory leak with skin scripts? #17
Comments
any thoughts on this @jensens ? |
@djay It doesn't look to me like the registry is storing an acquisition-wrapped object ( z3c.jbot/src/z3c/jbot/patches.py Line 135 in d022ba5
Maybe an IPubEnd handler to delete |
@davisagli its the key thats the problem not the value. You can see from the 2 tuple in the objgraph chain. I'm not sure of the implications but as far as I can I understand you don't need the full object for the key? Does it really matter the request aquisition path however?
yes also maybe a good idea. Although a request with attached response is not great to hang onto regardless. which package would deleting anotations go? memoize? |
@djay I don't think the acquisition wrapper matters, since the function re-wraps the cached inst before returning it. But you'll have to try it yourself and see what happens, since the package isn't well tested. |
@davisagli the key has the original wrapped object in it unchanged.
Another way to solve that might be to use a weakref for annotations so it would get naturually be cleaned up. or at least for memoize. since its a cache anyway. |
David Glick wrote at 2024-2-6 19:58 -0800:
...
Maybe an IPubEnd handler to delete `request.__annotations__` would help
Should you find out that this really makes a difference, then
the ``ZPublisher` request's `clear` method should get enhanced.
This method is called at the end of request processing and responsible
to free all resources held by the request. This should include
`__annotations__' (but apparently does not currently).
|
BUG/PROBLEM REPORT / FEATURE REQUEST
What I did:
I've been trying to track down a memory leak with too many PortletRenders being kept in memory.
They seem to link back to z3c.jbot.patches.registry.
This seems to keep a acquisition wrapped references to the script but for all different weird combinations of the paths that can access that script. The wrapping contains a request. The request contains memoization which contains a lot of stuff including portlet renders.
What I expect to happen:
I'm not sure I understand how jbot is supposed to work with skins but I would have thought it doesn't need to keep the wrapping or the request or even all teh different ways its was accessed.
What actually happened:
What version of Python and Zope/Addons I am using:
this was on plone 5.0 with 0.7.2 z3c.jbot but I increased to 1.1.1 and it still happened.
The text was updated successfully, but these errors were encountered: