Subject: | ENORMOUS memory leak |
If you run
use CPAN::SQLite;
my $obj = CPAN::SQLite->new (...);
$obj->index();
several(!) times inside a loop, you will be amazed to have 150MB allocated for a recent
cpan package set.
For.Each.Run !
Which is not overly surprising given the myriad of references leading back somewhere into
the object hash.
To make matters worse, the index() method allocates a private index object:
my $index = CPAN::SQLite::Index->new ....
$index->index();
then fills it, and lets it go out of scope. The toplevel $index will be garbage collected, but
not the 10000s of info and obj components trapped inside cycles.
On the outside - as a caller - I do never have control over the $index data, so I do not
even have a chance to break all the cycles before memory is lost.
I would appreciate a response how to approach a fix (weakening info and obj did not fix
the issue), or whether it is more wise to think about alternative packages.
Thx for your time!
rgds, \rho