Panic Memory leaks

Bjorn Pettersen BPettersen at NAREX.com
Mon Jan 6 12:55:36 EST 2003


> From: sundar raman [mailto:sunram78 at hotmail.com] 
> 
> Hai members,
>         I have been using Python for the few weeks. So I 
> don't want to 
> comment about python. I used Python/C API for developing an 
> extension. I properly made memory management through python 
> memory allocation and 
> deallocation functions such as PY_DECREF.I properly 
> initialized python by 
> PY_initialize and finally deinitialized through py_finalize. 
> But still I am 
> not able to get rid of memory leaks. I even checked the 
> reference counts 
> through quick watch feature of VC++. It shows some
> incredibly high values. I am not able to understand what is 
> going on inside 
> these functions. Please help me to solve this problem.
> Urgent!.

Judging from your capitalization I would guess that you're not getting
the details of the reference counting right. Make sure you know the
difference between borrowed and new references and go through your code
to make sure you're not decref'ing too many times (it sounds like you're
seeing a wrap-around effect, although that doesn't explain the memory
leak). If you need more help, you'll need to debug your program to the
point where you've got only a handful of lines left that still shows the
problem. Then you can post your code. (You can also post it earlier, but
then you're much less likely to find someone with enough free time to
help you <wink>).

-- bjorn

ps: marking something urgent on a newsgroup usually implies an attempt
to make other people do your work. I'm guessing that wasn't the
impression you meant to give...





More information about the Python-list mailing list