I'd also be curious to know if there are any tools that can do this for you. In the meantime, there are a few things that you can do to resolve this. First, if you are using 5.6.0, upgrade to 5.6.1. 5.6.0 is known to have quite a few memory leaks. Also, check to see if you have any circular references. Perl's garbage collection relies on reference counting and circular references need to be broken in the code or else those items won't get garbage collected.
Other causes of memory leaks can be poorly scoped code or poorly designed code. Using external applications with Perl can also cause issues. What OS are you running on? What tools are you using? Are you writing any XS or Inline code (Inline can cause issues if you fail to declare scalars as mortal). Are you forking anything or using threads? There are so many ways to introduce leaks that it's tough to say what's happening without a better idea of what you are doing.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|