[Israel.pm] Garbage Collection Question

Issac Goldstand margol at beamartyr.net
Mon May 10 09:23:10 PDT 2004


AHHHHH!  You call that *positive*?!?  I'd rather a huge process in memory
than in swap any day!  Swapping makes everything on the system run slower.

  Yitzchak

----- Original Message ----- 
From: "semuel" <semuel at semuel.co.il>
To: "'Perl in Israel'" <perl at perl.org.il>
Sent: Monday, May 10, 2004 8:13 PM
Subject: RE: [Israel.pm] Garbage Collection Question


> Hello There.
>
>
> Why does everybody sees only the bad things?
> Think positively: the unwanted allocated memory won't be accessed, and the
> OS will eventually flash the inactive memory pages to the swap, where they
> will sleep until the application will need that memory again.
> No big deal.
>
> Semuel.
>
>
> -----Original Message-----
> From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On Behalf
> Of Jason Elbaum
> Sent: Sunday, May 09, 2004 11:45 AM
> To: Perl in Israel
> Subject: Re: [Israel.pm] Garbage Collection Question
>
> Yuval Yaari wrote:
>
> > When that variable goes out of scope or is catched by the
> > garbage fairy, Perl will not release that 1MB to the kernel right away,
it
> > will reuse it in case it needs it later on during execution."
>
>
> Many operating systems never really allow a process to return allocated
> memory to the OS until the process exits. Processes can only grow, not
> shrink. This may be due to an assumption that if a process once needed X
> MB, it will probably need it again some time, and the churn by
> repeatedly allocating and deallocating it to the process is more
> expensive to the OS than just leaving it there.
>
> As a rule of thumb, you're better off not allocating massive data
> structures unless you really need to access all the data at once.
>
>
> Jason Elbaum
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://www.perl.org.il/mailman/listinfo/perl
>
>
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://www.perl.org.il/mailman/listinfo/perl
>




More information about the Perl mailing list