Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • And, of course, even if all memory for that string is deallocated, Perl hangs on to it and never gives it back to the OS. This is a common question on mod_perl lists: "My Apache children just keep on eating memory!"


    • What is this rampant fallacy of applications giving memory back to the OS? That is completely dependent on the implementation of the malloc, and in many systems the (virtual) memory use never goes down, only up. I think glibc malloc does memory allocation using mmap(), and the munmap() by free() does make the process virtual memory use go down. But nevertheless, expecting free() (or at Perl level, undef()) to make one's memory use (as shown by, say, ps), is a false assumption. Completely explaining it requires explaining virtual memory and some inner workings of malloc, but off-hand a simpler cure is to tell people to look at the resident set size (aka working set) size, instead of the virtual set size.