Mr. Shawn H. Corey schrieb: > On Mon, 2008-12-22 at 18:10 +0100, Patrick Kirsch wrote: > >> Is there a possibility to influence it, to free memory (in the sense >> of >> give it back to the OS)? >> >> > > Does your OS have a function that allows processes to return memory to > it? Many do not. Most of the time, when a process frees memory, it can > only re-use it itself. > > 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. Thanks, -- Patrick Kirsch Softwareentwickler Bookandsmile GmbH Inselstraße 20 04103 Leipzig Tel: 0341 / 30 89 51 12 - Email: pkir...@bookandsmile.de Web: http://www.billigflieger.de | http://www.bookandsmile.de -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/