« Return to Thread: Memory leaks - what causes them?

Re: Memory leaks - what causes them?

by David Norwood-3 :: Rate this Message:

Reply to Author | View in Thread

Gregg wrote:

> David Norwood wrote:
>
>> To tell you the truth, I've seen this question asked many times but
>> never seen an example of code that causes a memory leak in misterhouse.
>
> It's always been unbounded arrays that I've seen be the culprit.
> Specifically, shoving the same value or object into an array w/o
> checking on its existence first (if appropriate).  An example here of
> proper bounding is Base_Item::add_item_if_not_present.  If memory leaks
> happen on reload, then it's usually non-object arrays that I've seen in
> both common code and libs.

I've narrowed my memory leak problem down to the rss_file_process subroutine
in my mh/code/common/rss_subscriber.pl script.  Each of the arrays and
hashes are defined locally to the subroutine in "my  ..." statements.
Doesn't that mean the memory they take up is freed when the subroutine
returns?

Would you mind taking a look at the rss_file_process subroutine in
mh/code/common/rss_subscriber.pl and see if you find a problem?

David



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

 « Return to Thread: Memory leaks - what causes them?