On Thu, 28 Sep 2000, Doug MacEachern wrote:
> On Tue, 29 Aug 2000, Lyle D. Brooks wrote:
>
> > This is my first time posting to this list, so forgive me
> > if this question has been asked before (I did not see it in
> > the archives or in the mod_perl guide).
> >
> > Apache::Status seems like a nice module, but I don't understand
> > what the Memory usage section is telling me.
> >
> > For a given package, I have a function foo() that has a line
> > like this.
> >
> >
> > foo 48293 bytes | 1172 OPs
> >
> >
> > Here's my questions...
> >
> > 1) 48293 bytes is what? Is that code?, stack?, data? or a combination
> > of some of the three?
>
> TerseSize measures the sizeof() all structures (and strlen() of any
> strings) pointed to by the syntax (op) tree, lexical variables and
> globals.
>
> > 2) 1172 OPs - what's an OPs? Is it good to have more or less? How does
> > that affect memory usage?
>
> see matt's explanation. less is better.
>
> > 3) Without changing the code, I can reload the memory usage page and the
> > same function foo() will generally have the same number of bytes, but
> > not always. The OPs always seem to remain the same number however. The
> > bytes can vary but they don't seem to grow a great deal. Is this varying
> > number a memory leak in the function? If not, what causes the number to
> > vary from one invocation to the next?
>
> i'm not sure if stas has added a section to guide, but this has been
> explained a bunch of times here on the list. in a nutshell, Perl hangs
It's there:
http://perl.apache.org/guide/performance.html#Are_My_Variables_Shared_
And probably in a few other places, search for Apache::Peek and
Devel::Peek. But these all talk about this effect on the way of showing
something else. I guess I should make an explicit section that stresses
this point.
> onto many of the allocations your scripts makes, such as the first
> time a variable is used by a script (they are all NULL at compile
> time), string copies, array and hash sizes, scratch pads for things like
> join, concatination, etc. B-LexInfo includes a handler to show this
> behavior in action.
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:[EMAIL PROTECTED] http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perlmonth.com perl.org apache.org