cvs commit: perlfaq perlfaq3.pod

[email protected]
Newsgroups perl.cvs.perlfaq
Message-ID <[email protected]>
cvsuser     02/05/06 06:11:13

  Modified:    .        perlfaq3.pod
  Log:
  How can I free an array or hash so my program shrinks?
      * removed comments on particular operating systems since they
      were a bit dated
  
      * added comment about Perl's own malloc versus the OS supplied one
  
  Revision  Changes    Path
  1.22      +9 -12     perlfaq/perlfaq3.pod
  
  Index: perlfaq3.pod
  ===================================================================
  RCS file: /cvs/public/perlfaq/perlfaq3.pod,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -w -r1.21 -r1.22
  --- perlfaq3.pod	28 Apr 2002 15:51:10 -0000	1.21
  +++ perlfaq3.pod	6 May 2002 13:11:13 -0000	1.22
  @@ -1,6 +1,6 @@
   =head1 NAME
   
  -perlfaq3 - Programming Tools ($Revision: 1.21 $, $Date: 2002/04/28 15:51:10 $)
  +perlfaq3 - Programming Tools ($Revision: 1.22 $, $Date: 2002/05/06 13:11:13 $)
   
   =head1 DESCRIPTION
   
  @@ -617,17 +617,14 @@
   
   =head2 How can I free an array or hash so my program shrinks?
   
  -You can't.  On most operating systems, memory allocated to a program
  -can never be returned to the system.  That's why long-running programs
  -sometimes re-exec themselves.  Some operating systems (notably,
  -FreeBSD and Linux) allegedly reclaim large chunks of memory that is no
  -longer used, but it doesn't appear to happen with Perl (yet).  The Mac
  -appears to be the only platform that will reliably (albeit, slowly)
  -return memory to the OS.
  -
  -We've had reports that on Linux (Redhat 5.1) on Intel, C<undef
  -$scalar> will return memory to the system, while on Solaris 2.6 it
  -won't.  In general, try it yourself and see.
  +You usually can't. On most operating systems, memory
  +allocated to a program can never be returned to the system.
  +That's why long-running programs sometimes re-exec
  +themselves. Some operating systems (notably, systems that
  +use mmap(2) for allocating large chunks of memory) can
  +reclaim memory that is no longer used, but on such systems,
  +perl must be configured and compiled to use the OS's malloc,
  +not perl's.
   
   However, judicious use of my() on your variables will help make sure
   that they go out of scope so that Perl can free up that space for
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.