I know that Perl uses reference count based garbage collection. When a variable goes out of scope, the reference count is decremented and if REFcount goes to 0, the memory is de
Perl may have marked the memory as freed, but it doesn't necessarily mean that it has been freed back to the OS. Your Perl program may reuse that memory. Try running func
again. You shouldn't see an increase in the amount of memory used.
You may want to set the environment variable PERL_DESTRUCT_LEVEL and see if that makes any difference, but I doubt it.
Garbage collection is not one of Perl's greatest strengths.