On Mon, 2008-12-22 at 18:36 +0100, Patrick Kirsch wrote:
> I'm using: Linux 2.6.27.6 #2 SMP x86_64; Distribution: OpenSUSE 11.0 .
> In my opinion the Linux kernel is/should be able to rearrange freed
> memory between processes (I think e.g. of the slab).
> 
> But let me show another example:
> $foo = 'X' x 100000000;
> getc;
> undef $foo;
> getc;
> $foo2 = 'X' x 100000000;
> getc;
> 
> gives (again output from 'ps auxwf'):
> user   15185 18.0  4.8 211000 197020 pts/5
> user   15185  5.0  2.4 113340 99364 pts/5
> user   15185  4.3  7.2 308660 294684 pts/5
> 
> As you see some RAM is given back to the OS (~50%, [99364/197020]) .
> BUT: I would expect that the Perl virtual machine (memory management)
> reuses the allocated RAM from $foo for $foo2.
> As you see $foo is not used anymore in the program context, but the
> memory management still holds some RAM for it present (I mean
> why :-) ?
> ). As my education is C, I would not expect this behavior.
> 

I did not expect this behaviour either.  I would think it would give
none back or most of it; there would be some overhead.

Question :  Are you having a problem with memory or is this just to
satisfy your curiosity?


-- 
Just my 0.00000002 million dollars worth,
  Shawn

Believe in the Gods but row away from the rocks.
  -- ancient Hindu proverb


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to