SPUG: Question for somebody

Richard Anderson starfire at zipcon.net
Thu Nov 2 20:18:20 CST 2000


This in not correct - memory is freed by Perl's garbage collection algorithm
when a lexically scoped variable goes out of scope, unless there is a
pathological circular reference situation.

If Perl really did not return the memory to the OS until the program exited,
recursive subroutines would be impossible in Perl.

Richard.Anderson at rayCosoft.com       RayCosoft, Professional Services Group
Perl/SQL/Unix software engineering    www.rayCosoft.com
www.zipcon.net/~starfire/home              Seattle, WA, USA
----- Original Message -----
From: "Lauren Smith" <LaurenS at bsquare.com>
To: "'Owskey, Tom'" <tom.owskey at attws.com>; <spug-list at pm.org>
Sent: Thursday, November 02, 2000 11:18 AM
Subject: RE: SPUG: Question for somebody


> If you lexically scope variables using 'my', variables will delete
> themselves when their scope is up.  However, this does not mean that the
> memory is recoverable by the OS.  It means that Perl has released the
memory
> for its own future use.  Aside from memory leaks, a Perl process should
only
> take up as much space as its peak memory usage.
>
> Lauren
>
> > -----Original Message-----
> > From: Owskey, Tom [mailto:tom.owskey at attws.com]
> > Sent: Thursday, November 02, 2000 10:19 AM
> > To: spug-list at pm.org
> > Subject: SPUG: Question for somebody
> >
> >
> > Hi can anybody tell me how to destroy an object to keep the
> > program from
> > eating up memory.
> >
> > Thomas Owskey.
> >
> >  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> > - - - - - - -
> >      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/
> >
> >
>
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>      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/
>
>
>
>


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     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