Re: Weird memory consumption problem.

2005-12-20 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Bo Peng <[EMAIL PROTECTED]> writes >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. Don't know if you were using Windows, but if you were then Python Memory Validator would ha

Re: Weird memory consumption problem.

2005-12-20 Thread Bo Peng
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 res

Re: Weird memory consumption problem.

2005-12-20 Thread Bo Peng
Steven D'Aprano 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? valgrind does not detect anything so it does not look like memory leak. I just can not figure out why val[0], readonl

Re: Weird memory consumption problem.

2005-12-20 Thread Steven D'Aprano
Bo Peng wrote: > The real code is much more complicated and I can not possibly explain > the details here. Can anyone *guess* what might go wrong? 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?

Weird memory consumption problem.

2005-12-19 Thread Bo Peng
Dear list, I spent the last 12 hours in catching this bug (?) and what I found out is very difficult to explain: Basically, I need to call a user-provided function many times, with a tuple as parameter. C/C++ side: (class A, constructed using a python function m_func) // create in the con