Re: [OT] finding memory hungry bits of my code

2009-04-10 Thread Mike Astle
If there is something out there that does for perl memory usage analysis what NYTProf does for profiling, then I am >dying< to get my grubby little hands on it. My ideal tool would give me a breakdown of the memory used by current SVs by package. Not sure if I'm saying that right or if this i

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Tatsuhiko Miyagawa
B::TerseSize might be what you want, and Apache2 has a Status handler to enable that. http://search.cpan.org/dist/mod_perl/docs/api/Apache2/Status.pod#StatusTerseSizeMainSummary In a standalone script you can do: use B::TerseSize; use Devel::Symdump; my $stab = Devel::Symdump->rnew("main"); my %

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Dave Hodgkinson
On 9 Apr 2009, at 15:08, Edmund von der Burg wrote: 2009/4/9 Andy Armstrong : That sounds as if it could just be Perl getting up to cruising (memory) altitude. Perl isn't especially keen on giving memory back to the OS once it's used it; instead it keeps it hanging around and uses it to s

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Simon Wistow
On Thu, Apr 09, 2009 at 10:27:57AM +0100, Edmund von der Burg said: > What is the equivalent for memory usage? Devel::Gladiator?

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Mark Hughes
On Thu, Apr 9, 2009 at 2:08 PM, Edmund von der Burg wrote: > 2009/4/9 Andy Armstrong : >> That sounds as if it could just be Perl getting up to cruising (memory) >> altitude. Perl isn't especially keen on giving memory back to the OS once >> it's used it; instead it keeps it hanging around and use

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread David Cantrell
On Thu, Apr 09, 2009 at 02:08:26PM +0100, Edmund von der Burg wrote: > PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND > 2050 web 15 0 126m 112m 5624 S0 1.4 0:21.66 > /usr/sbin/apache-perl > 1702 web 15 0 126m 112m 5420 R6 1.4 0:22.88 > /usr/s

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Dagfinn Ilmari Mannsåker
Andy Armstrong writes: > On 9 Apr 2009, at 14:08, Edmund von der Burg wrote: >> Do these numbers look reasonable to others? The SHR value seems crazy >> low, but that might be me reading it all wrong. > > > SHR is AFAIK memory that's been explicitly shared and excludes memory > that just happens

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Mark Morgan
On Thu, Apr 9, 2009 at 2:08 PM, Edmund von der Burg wrote: > Perhaps you're right - but our cruising altitude would seem to be very > high: our biggest processes according to top: I'll take a guess that you're using Redhat, or some derivative thereof. The perl included with that includes a lot o

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Ben Evans
Edmund von der Burg wrote: 2009/4/9 Andy Armstrong : That sounds as if it could just be Perl getting up to cruising (memory) altitude. Perl isn't especially keen on giving memory back to the OS once it's used it; instead it keeps it hanging around and uses it to satisfy future allocations.

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread peter
Quoting Edmund von der Burg : I don't think that it is a memory leak - the size tends to remain constant after a few requests (it's a webapp - Catalyst under mod_perl). Run 'ab' against your app to check that is indeed the case. More info at http://modperlbook.org/html/14-2-6-Memory-Leakage.ht

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Andy Armstrong
On 9 Apr 2009, at 14:08, Edmund von der Burg wrote: Do these numbers look reasonable to others? The SHR value seems crazy low, but that might be me reading it all wrong. SHR is AFAIK memory that's been explicitly shared and excludes memory that just happens to be shared by COW. Those figur

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Edmund von der Burg
2009/4/9 Andy Armstrong : > That sounds as if it could just be Perl getting up to cruising (memory) > altitude. Perl isn't especially keen on giving memory back to the OS once > it's used it; instead it keeps it hanging around and uses it to satisfy > future allocations. Perhaps you're right - but

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Mark Blackman
On 9 Apr 2009, at 12:31, Edmund von der Burg wrote: 2009/4/9 Joel Bernstein : Can you give some more information as to the nature of the code and its naughtiness? I don't think that it is a memory leak - the size tends to remain constant after a few requests (it's a webapp - Catalyst under

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Peter Corlett
On Thu, Apr 09, 2009 at 12:31:08PM +0100, Edmund von der Burg wrote: [...] > I don't think that it is a memory leak - the size tends to remain constant > after a few requests (it's a webapp - Catalyst under mod_perl). I'm not convinced that mod_perl is a good environment to run web apps as it make

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Mark Morgan
On Thu, Apr 9, 2009 at 12:40 PM, Andy Armstrong wrote: > That sounds as if it could just be Perl getting up to cruising (memory) > altitude. Perl isn't especially keen on giving memory back to the OS once > it's used it; instead it keeps it hanging around and uses it to satisfy > future allocation

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Andy Armstrong
On 9 Apr 2009, at 12:31, Edmund von der Burg wrote: I don't think that it is a memory leak - the size tends to remain constant after a few requests (it's a webapp - Catalyst under mod_perl). I reckon that most likely we're doing lots of innocent little bits of in-memory caching which all add up

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Edmund von der Burg
2009/4/9 Joel Bernstein : > Can you give some more information as to the nature of the code and its > naughtiness? I don't think that it is a memory leak - the size tends to remain constant after a few requests (it's a webapp - Catalyst under mod_perl). I reckon that most likely we're doing lots

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Andy Armstrong
On 9 Apr 2009, at 10:27, Edmund von der Burg wrote: I have some Perl code which is being naughty with its memory. If this were a speed issue I'd throw Devel::NYTProf at it. What is the equivalent for memory usage? Do you suspect that it's leaking or just using lots of memory? -- Andy Armstr

Re: [OT] finding memory hungry bits of my code

2009-04-09 Thread Joel Bernstein
On 9 Apr 2009, at 10:27, Edmund von der Burg wrote: Hello, I have some Perl code which is being naughty with its memory. In a leaky sense? If this were a speed issue I'd throw Devel::NYTProf at it. What is the equivalent for memory usage? Devel::LeakTrace, Devel::Cycle, etc for finding m

[OT] finding memory hungry bits of my code

2009-04-09 Thread Edmund von der Burg
Hello, I have some Perl code which is being naughty with its memory. If this were a speed issue I'd throw Devel::NYTProf at it. What is the equivalent for memory usage? Hugs Kisses, Edmund -- e...@ecclestoad.co.uk - http://ecclestoad.co.uk Help Perl newbies: http://www.send-a-newbie.com/