Subject: | Leftover mappings from thread creation |
---------paste mnooning repy
Hello Kevin,
I suspect you are correct.
I also suspect I am about to be the bearer of bad news.
You see, I do not know thread programming. I have accepted baton in
maintaining Net::Daemon because the maintainer before me at already left
the project, and bugs were cropping up that needed fixed, and the
original author was no longer working with it either.
One of the prior problems, now fixed thanks to some industrious and
knowledgeable others, was with threads programming. I contacted the
original author who wrote me that the threads portion was put in after
he left the project. So .... I am going to enter this as a bug at
rt.cpan.org and hope that someone (like you?) plus others, will come up
with ideas to fix it.
The last three bugs I fixed were really fixed because other people wrote
in ideas. I just put it together. I hope this will happen again here.
Thanks
---------end paste
------- paste: Kevin Vincent Sheehan wrote:
M,
First off, let me praise Net::Daemon in no uncertain terms. It let me
set up a daemon to monitor 150 lab systems for temperature, performance
and let me control idling them to keep our A/C from going out. I'm not
even a good Perl programmer, and it only took me 2 days. :-)
Secondly, I think I've found a bug. Running the daemon for some time
creates a very large VM footprint that consists of leftover mappings
from thread creation. (The daemon is contacted every 10 minutes).
I believe that the Daemon code fails to do a ->join() or ->detach() on
the created threads. Under 3 different distros (RHEL3, FC4, rPath) I
see the thread exit (which cleans it up as far as the kernel is
concerned) but I don't see the mappings torn down, so they collect over
time. I simulated the problem with threads alone and see the same behavior.
ChildFunc for these distros uses the 'ithreads' method, which means that
threads()->new() is called. I don't see the thread saved, and I don't
see ->join() called anywhere. ->detach() might be sufficient to
acheive the desired effect, but I've not tried it out on our systems.
------- end paste