Subject: | Memory Leak (sort of ...) |
Date: | Thu, 27 Dec 2018 01:00:56 +0000 |
To: | "bug-Parse-STDF [...] rt.cpan.org" <bug-Parse-STDF [...] rt.cpan.org> |
From: | Stefan Eichenberger <se_misc [...] hotmail.com> |
Hi Erick,
not strictly a bug, but examples don't release memory (and free_record()
is not documented on Parse::STDF side:
Parse:: STDF typically does the following:
$s = Parse::STDF->new($file);
while ($s->get_record()) {
if ($s->recname() eq 'MIR') {
$r = $s->mir();
# do something here
$r->free_record() # <--- needed to release memory
malloc'ed by libstdf
}
}
With large STDF files, memory consumption can easily go through the roof
(I estimate approx. 5x STDF file size) if memory is not freed.
Stefan