How can I tell Perl, built with glibc, to release the memory back to the operating system thus shrinking the resident size?
I seem to recall the being possible, but do not remember how it was done.
Can I for instance, nuke a typeglob and free all the space allocated inside it?
Looking at the perl faq it says,
You usually can't. Memory allocated to lexicals (i.e. my() variables) cannot be reclaimed or reused even if they go out of scope. It is reserved in case the variables come back into scope. Memory allocated to global variables can be reused (within your program) by using undef() and/or delete(). On most operating systems, memory allocated to a program can never be returned to the system. That's why long-running programs sometimes re- exec themselves. Some operating systems (notably, systems that use mmap(2) for allocating large chunks of memory) can reclaim memory that is no longer used, but on such systems, perl must be configured and compiled to use the OS's malloc, not perl's.
So I want to make sure my perl is compiled with glibc and that I have the conditions to do it. The docs say "you usually can't", well I have glibc and I want to be able to do it.
perl -V | grep -i malloc
usemymalloc=n, bincompat5005=undef
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP