Re: Tracking down memory hogs

2006-06-23 Thread Jay Buffington
On Thu, 2006-06-22 at 11:20 -0700, Jay Buffington wrote: I'm considering writing a PerlLogHandler that will print out the memory usage (using GTop) before and after each request so I can find the offending code path. I wrote this script and it turned out to work very well. It's small, so I inc

Re: Tracking down memory hogs

2006-06-22 Thread Perrin Harkins
On Thu, 2006-06-22 at 11:20 -0700, Jay Buffington wrote: > I'm considering writing a PerlLogHandler that will print out the > memory usage (using GTop) before and after each request so I can find > the offending code path. That's what I would do. You could also keep track of the size in a global

Tracking down memory hogs

2006-06-22 Thread Jay Buffington
Hi, I've been looking for a good technique to find out what module is using all my memory. Imagine some sneaky user creates this module: package MemoryHog; my %big_hash; sub handler { my $r = shift; foreach (1..1_000_000) { $big_hash{$_} = $_ * 5; }