Subject: | When testing large collections of modules, can die due to memory exhaustion. |
Test modules are currently not unloaded from memory. I tried to test
over 2,000 modules on an Amazon Micro-instance and the process was
eventually killed, presumably because it had exhausted the memory on the
machine.
Borrowing the patterns from "Class::Unload" could be used to unload a
module from memory as soon as it has been tested. (At least the symbols
are cleaned up, I'm not sure if Perl returns the memory or not).
I attempted the patch myself, but ran into complications.
There is this line:
$module->use;
However, I found that it was working when "$module" had a value of
"perllib::JSON::XS".
The challenge is this: given a file name that points a Perl module, how
do you detect which parts of the path belong to the Perl name space, and
which parts are merely part of the file system? So far, you don't have
to care, because UNIVERSAL::require can load the module anyway.
One option might be inspect %INC before and after the 'use' statement
and see what changed, and then unload all the differences, but I didn't
go that far.