Replies: 1 comment 4 replies
-
Thanks for sharing this issue. We have been trying to resolve a range of swig related memory leaks. @juan-g-bonilla or @patkenneally , any thoughts on this suggestion? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There seems to be a memory leak when writing Python SWIG messages -- e.g., on OS-X, I'm seeing a steady increase in memory usage when the below code is run:
If I'm understanding how SWIG works correctly, this seems to be driven by the
PySequence_GetItem
call here: link (code snippet below):PySequence_GetItem
, according to its docs, generates a new reference -- but in this code, we're never freeing that reference even after we do thememcpy
. I think this should be fixed by adding a couplePy_DECREF(o)
statements (this fixes the memory leak on my hardware):Beta Was this translation helpful? Give feedback.
All reactions