-
Notifications
You must be signed in to change notification settings - Fork 16
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
Memory leak #8
Comments
Two problems:
|
Is this something you're attacking or shall I have a go? |
Go ahead. I'd guess using weakrefs instead of Like cffi's "gc(cdata, destructor)" https://bitbucket.org/cffi/cffi/src/af4e381b5e99c27c466377145a84eeece6e5c199/cffi/gc_weakref.py?at=default I gave you commit rights btw, so you should be able to push directly. |
As per #8, there was a leak due to cycles and the definition of a `__del__` destructor. This instead uses weak proxies to be notified of deletion and invoke the correct destructor. A new type, `_BaseFinalizer` is introduced, where one can override the destruction behaviour by defining `destructor`.
It also appears that |
I'm looking at the It calls Should we add an |
@lazka -- this is the sort of thing I've done which seems to do the right thing. However, I get the impression that you intended for this to already work so I don't know if my solution is in the spirit of your other code. I've not made a pull request for the linked commit yet, it perhaps belongs on top of #10 if you are happy with the approach. |
This is the code for |
Tidying up my personal issues list, so closing this. Please create a new issue if you're still interested in tracking it. |
I'm still hitting this problem. Not sure what a clean solution is, advice welcomed! This demonstrates the problem: from pgi.repository import Poppler as poppler
doc = poppler.Document.new_from_file("file://test.pdf", "")
for i in range(doc.get_n_pages()):
p = doc.get_page(i)
# p.unref()
# doc.unref() If I call So I'd like to determine if the |
Ping. I'd like to close this (preferably with a resolution), any advice? |
Observing same issue while using Gsf, it is leading to file descriptor leak -
Calling unref releases the file descriptor. (Deleting the objects doesn't help) |
This demo has a memory usage which scales with
N
:Calling
g_free
onp._obj
causes a double free, so the problem is python-side. The number of alive objects grows by 4 per iteration.The text was updated successfully, but these errors were encountered: