in reply to Re: How to put a fat program on a (memory) weight-loss diet?
in thread How to put a fat program on a (memory) weight-loss diet? [SOLVED]
I guess that's the first question. I did an strace on it, and the first thing that I see is that the mmap() calls total up to 12,512,290. (But this includes 7,340,032 that did not succeed...)
“Ahem... let me try that again... awk, if you please... thank you. Now, where was I?”
The mmap calls for the program as it runs to normal completion total 8,329,178 bytes. Which, frankly, doesn't seem like a lot.
I really don't know what else might be found in an strace output that would point the way to more memory-allocations. I do know a lot about the program itself.
This is a Moose / Mojolicious program which uses DBIx::Class for database-access and Template::Toolkit. It doesn't get fancy with a lot of memory allocation... at least, not in my code. All in all, I think it's a fairly “run of the mill” application that does use a lot of CPAN material.
Since the program does run, after a fashion, even with these constraints, about the only logical culprit I can think of is DBIx::Class. That is to say, “that's what tips it over the edge of the cliff,” whereupon it bounces and goes on to successfully produce the template and so-on.
But what I am hoping to find is something “quick 'n dirty” that will substantially reduce the footprint, and do so quickly without demanding major logic-changes. (Y’know, like “rewriting it in PHP...” ;-) )
Edit: There are also brk() calls, the first one setting the limit to 0x814df20 and the last to 0xa267000, a span of 34mb... which does not look good. :~}
Learning... it's not for sissies...
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to put a fat program on a (memory) weight-loss diet?
by BrowserUk (Patriarch) on Mar 04, 2009 at 14:38 UTC | |
by locked_user sundialsvc4 (Abbot) on Mar 04, 2009 at 17:46 UTC | |
by BrowserUk (Patriarch) on Mar 04, 2009 at 18:34 UTC | |
|
Re^3: How to put a fat program on a (memory) weight-loss diet?
by stvn (Monsignor) on Mar 04, 2009 at 22:05 UTC |