Re: Apache::Status Memory Usage metrics

2000-09-29 Thread Stas Bekman

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





Re: Apache::Status Memory Usage metrics

2000-09-28 Thread Doug MacEachern

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
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.




Apache::Status Memory Usage metrics

2000-08-29 Thread Lyle D. Brooks

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?  

2) 1172 OPs - what's an OPs?  Is it good to have more or less?  How does 
   that affect memory usage?

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?

More questions later...

The documentation seemed to be silent in regards to answering these questions.

Any insights would be much appreciated.



Re: Apache::Status Memory Usage metrics

2000-08-29 Thread Matt Sergeant

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?  

Code and data combined, AFAIK. Its data from some B::Terse or B::TerseSize
module. See the documentation in that for more details.

 2) 1172 OPs - what's an OPs?  Is it good to have more or less?  How does 
that affect memory usage?

Perl code is based on OP codes, much like Java Bytecode. It is good to
have less, as it means (sometimes) faster execution and less memory usage.

-- 
Matt/

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org