SPUG: Question for somebody -- Releasing memory

Yitzchak Scott-Thoennes sthoenna at efn.org
Sun Nov 5 00:32:31 CST 2000


In article <8EC7FE6B4722D411848B00A0C9E11CBD8B91E2 at EXCH02>,
Daniel Pommert <dpommert at bestnet.com> wrote:
> As stated by everyone else, normally, when the last reference to an object
> is eliminated, the object is destroyed and the memory is released to the
> memory pool.
> 
> There are some gotchya, however:
> 1) As mentioned above, sometimes the Perl system, itself has a memory leak.
> This is rare, is usually minor is size, and can usually be discounted.
> 2) Reference cycles can cause objects to never be considered to be
> "free-able".

There's also: 3) reference count erroneously too high.  Some times hairy
XS code can increment a reference count and forget to decrement it when
appropriate.  Devel::Peek::SvREFCNT will return a scalar's actual refcnt
for you to look at.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list