in reply to Re: Re: Re: Memory usage breakup
in thread Memory usage breakup

Interesting. In Unix, you can allocate memory using an anonymous mmap, then return it to the system with munmap. You can do that by hand if you want, packing data into the allocated region, then unpacking it back out when you need it.

This is horribly inconvenient, of course. I wonder if an XS module could use mmap to allocate a big chunk of memory and instruct Perl's allocator to use it, then later free this memory and tell Perl to use the normal allocator. I don't know anything about Perl internals, so I shouldn't be speculating like this, but it's so much fun. :)