Hi, I've reproduced your problem, and I think I've got a fix. If I look at the documentation for Lingua::EN::MatchNames I see you should use 4 arguments instead of 2:
use Lingua::EN::MatchNames; $score= name_eq( $firstn_0, $lastn_0, $firstn_1, $lastn_1 );
When I change your NameComp function to this:
sub NameComp () { foreach $curusername (@curuserlist) { my ($firstn_0, $lastn_0)= split '\s+', $_[0]; my ($firstn_1, $lastn_1)= split '\s+', $curlookup{$cur +username}; print "comparing $firstn_0, $lastn_0 to $firstn_1, $la +stn_1\n"; my $name_score = name_eq($firstn_0, $lastn_0, $firstn_ +1, $lastn_1); print "$name_score\n"; if ($name_score >= 80){ print "Found Match $curlookup{$curusername}\n" +; } } }
it not only runs a lot faster, the memory usage doesn't increase after the first round of NameComp. But this doesn't explain why the memory-usage keeps increasing in the original case, I'd like to know as well. As you might have seen in a previous post (Memory usage breakup), I'm quite interested in how to manipulate perl memory usage myself.

Please be very cautious naming stuff like this 'memory leaks', It's quite normal perl uses a lot of memory because all memory that is released when variables are not refered to anymore, is not released to the OS, but perl keeps this memory allocated (at least according to theory, in the post I mentioned people claim perl releases memory to the OS, which I haven't been able to reproduce on FreeBSD).


In reply to Re: Memory Leak when using Lingua::EN::MatchNames by eXile
in thread Memory Leak when using Lingua::EN::MatchNames by Cincyman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.