[Python.NET] Memory leak problem in function "AsManagedObject"
eliana.mendesp at gmail.com
Fri Jan 15 15:06:10 EST 2016
I'm having a memory leak problem when using the
function AsManagedObject(typeof(double)). Basically I have something like
PyTuple myTuple = PyTuple.AsTuple(result);
double result0 = (double)myTuple.AsManagedObject(typeof(double));
double result1 = (double)myTuple.AsManagedObject(typeof(double));
where "result" is just a PyObject that returned from a python function. I
simplified the code above just so you can understand better, but the thing
is that the line that calls "AsManagedObject” is executed thousands of
times and it is increasing significantly the memory heap (it goes over 3 GB
of memory in my scenario and it’s not released after execution). If I don't
call just this specific function the memory remains stable. But I don’t
know any other way to convert the PyObject to "double" unless using the
It sounds to me that some objects are allocated inside the
"AsManagedObject" method and they are not being released. Maybe it’s a bug
there. Any ideas? I'm using latest version of python for .NET.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PythonDotNet