|Think about Loose Coupling|
Re: memory leakby McA (Priest)
|on Jul 27, 2013 at 06:39 UTC||Need Help??|
check out the search functionality of this site. Using search term memory leak gives rather many interesting hits.
Besides of that: Memory leak means that memory is not released after it should be not used anymore. This happens in Perl when the reference counter doesn't drop to 0. And the cause for that are often circular references.
In your program I can't see a memeory leak, but probably others. You will need more memory the bigger the numbers are. This is by design.
A problem you have with Perl is, that Perl doens't give memory back to the OS. So when you check the memory consumption at the beginning and at the end of your function call you will see an increase of Perl's memory footprint. But you don't know if this memory is free for usage of later claims.
Look for the topics mentioned by me and I'm sure you find many informations.