in reply to Re: BEGIN initialization and memory
in thread BEGIN initialization and memory
Perl never reclaims used memory to your operating system during the course of your program.
According to the man that knows, this isn't exactly so, as he explained here.
You can actually what this happen in Win32 if you monitor memory usage with the task manager and type the following
P:\test>perl58 -de1 Loading DB routines from perl5db.pl version 1.19 Editor support available. Enter h or `h h' for help, or `perldoc perldebug' for more help. main::(-e:1): 1 DB<1> ;{ $s = 'X' x 30_000_000 } DB<2>
After entering that line into the debugger, I can watch the memory for the task grow to close 100 MB, and then fall most of the way back to the 4 MB that it started out as, as $s goes out of scope and its memory is returned to the OS.
You could probably do something similar using top under *nix.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: BEGIN initialization and memory
by blokhead (Monsignor) on Jul 23, 2003 at 07:54 UTC | |
by BrowserUk (Patriarch) on Jul 23, 2003 at 12:23 UTC | |
Re: Re: Re: BEGIN initialization and memory
by waswas-fng (Curate) on Jul 24, 2003 at 01:59 UTC | |
by BrowserUk (Patriarch) on Jul 24, 2003 at 02:35 UTC |