I just discovered an unpleasant memory leak using both each_array () and each_arrayref () from List :: MoreUtils.
These three lines of code are part of a routine executed four thousand times each time it starts. My goal is to give the correct format to the values ββalready in the hash. I have a fixed number of hash keys and a format string for each hash key.
my %hash = ();
If I stick with return; until my $two_arrays ... , the leak disappears. The same return; past the last line causes a leak.
Since the subroutine is part of the daemon program, I noticed a continuous increase in memory (both VIRT and RES).
Something I did wrong? Is there a memory leak of each_array () or each_arrayref () I don't know?
- List :: MoreUtil (Version 0.22)
- Perl 5.12.1 (x86_64 with threads) on Linux 2.6.32-32-generic (Ubuntu 10.04)
source share