[Pdx-pm] memory leak

Michael G Schwern schwern at pobox.com
Mon Apr 18 13:33:00 PDT 2005

On Mon, Apr 18, 2005 at 12:13:07PM -0700, Mark Deason wrote:
> I have a 200-ish line perl script that is leaking
> memory.  Is there an easy way to list the memory
> consumed for each variable?  More specifically, can I
> get a list of all variables including locals (not
> including modules) which I can then use to drive the
> first request?

Devel::Leak and Devel::LeakTrace should both be useful here as well as
Test::Memory::Cycle to look for circular reference which are the most
common causes of leaks.

Other common leaks include localizing just one key of a tied hash.

	local $foo{bar} = 42;

More information about the Pdx-pm-list mailing list