I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2006-09-14 20:45:31-07 by ssinyagin
Memory leak, possibly in shared pool

hi all,

I'm building the threads support into Torrus software (torrus.org)

The Collector process runs constantly as a daemon. In threaded version, the process memory footprint grows slowly but constantly, and in threading-disabled mode it doesn't encounter such problem.

The code in question is here:

Line 71 initializes the background thread. It will read from the queue and store the data in RRDtool files.

Line 474 adds a new job entry to the queue: it creates an empty shared array, then pushes the data into it, and then adds its pointer to the queue.

Line 499 reads the jobs from the queue, stores the data, and then releases the array reference. I suspect it's at this point that the memory is not actually freed up.

Current Perl version is 5.8.8 running on Solaris (binary packages available from www.blastwave.org). The same problem occurs with the original threads module that came with perl 5.8.8, and also with the latest threads version 1.41.

The same problem is noticed at another installation under Linux and Perl 5.8.5, confirmed with the original threads module. I don't have yet information about the latest module behaviour.

regards,

Stanislav Sinyagin ssinyagin@yahoo.com

Direct Responses: 3046 | 3047 | Write a response