in reply to memory deallocation

> I have read in just about every book I own that Perl handles garbage collection automatically

Being pedantic, Perl 5 does not have a garbage collector, it uses reference counting.
Few languages and run-time environments are capable of returning memory to the OS. Windows does allow so-called 'user-heaps', but I don't think many people use them. Even so Windows only allows whole unused pages (4kb/page on 32-bit Intel) to be returned to the OS, heap fragmentation is a common issue which will prevent this.
This does not happen automatically, the application (in this case, perl) has to call the API, usually HeapCompact.

Replies are listed 'Best First'.
Re^2: memory deallocation
by kyle (Abbot) on Oct 01, 2007 at 15:35 UTC

    Perl 5 does not have a garbage collector, it uses reference counting.

    According to Wikipedia, "Reference counting is often known as a garbage collection algorithm." I, for one, have always considered reference counting to be a simple garbage collector.