James Shirley schrieb:
> Hi, I'm trying to write a persistent perl daemon, but have noticed what
> looks like a memory leak, with perl_parse.
>
> It only seems to occur once dynamic loading of perl modules is enabled,
> here is my test kit:
...
> # ./showtime -e "use Time::HiRes;" &
> # watch -d ps u $!
>
> Notice RSS size keeps on getting larger, 20k/sec
> Works with other modules aswell
> I've run valgrind over it, and it cannot find any memory leaks..
> Any help would be much appreciated..
I believe DynaLoader:dl_unload_file is never called implicitly in the
module destructor, so you have to do that manually.
something like:
record the so in your object, and
sub DESTROY {
DynaLoader::dl_unload_file($shift->your_so)
if defined (&DynaLoader::dl_unload_file);
}
--
Reini Urban
http://phpwiki.org/ http://murbreak.at/