Re: Weird memory consumption problem.
- From: Bo Peng <bpeng@xxxxxxxx>
- Date: Tue, 20 Dec 2005 08:54:21 -0600
Bo Peng wrote:
Sorry, are you saying that the code you posted does NOT have a memory leak, but you want us to find the memory leak in your real code sight unseen?
Problem found. It is hidden in a utility function that converts the return value to a double. The refcnt of the middle result was not decreased.
PyObject* res = PyNumber_Float(obj);
val = PyFloat_AsDouble(res);
// missing
Py_DECREF(res);The problem is not that difficult to find, but it was 2am in the morning and I was misled by the different behavior of pyFun1 and pyFun2.
Thanks, Bo .
- Follow-Ups:
- Re: Weird memory consumption problem.
- From: Stephen Kellett
- Re: Weird memory consumption problem.
- References:
- Weird memory consumption problem.
- From: Bo Peng
- Re: Weird memory consumption problem.
- From: Steven D'Aprano
- Re: Weird memory consumption problem.
- From: Bo Peng
- Weird memory consumption problem.
- Prev by Date: Re: numarray :: multiplying all the elements in 1d array
- Next by Date: How convert text file between locale encoding and UTF-8?
- Previous by thread: Re: Weird memory consumption problem.
- Next by thread: Re: Weird memory consumption problem.
- Index(es):
Relevant Pages
|
|