Need an explanation of APR::Pool and it's use in mod_perl

2010-01-17 Thread Boysenberry Payne
Hello everyone,

I've been looking over the APR::Pool because some pools gets passed to some of 
my handlers and I was wondering how I could use it to good effect managing my 
memory better.
There are great instructions on the API for it, but no real explanation as to 
how to use the pool (at least not in the APR::Pool docs.)

I was wondering if anyone could explain how to use memory pools to manage 
memory, or point out some examples I might have missed.

I'm not looking for what's already in the doc, i.e. I already understand what 
is mean by the life cycle of the pool, destroy vs. clear, etc.  I'm looking for 
more of an example of how to use the pool with my memory, i.e. do I have to 
create my data structures in the pool somehow, or is it taken care of 
automagically somehow that isn't obvious?  It seems pretty low level, is it 
something I should avoid, via higher level modules or something like that?

Thank you,
Boysenberry Payne

A question of debugging/testing for when memory goes from shared to unshared

2010-01-17 Thread Boysenberry Payne
Hello Everyone,

After reading Practical mod_perl's section on Improving Performance with Shared 
Memory  and proper forking a bit, I'm wondering if I can setup a means for 
testing what is shared and when it becomes unshared in my memory usage.

I can't seem to currently get GTop installed on my OS X box (I'm sure that will 
get resolved shortly.)

So, I was wondering if anyone has come up with an alternative to determine a 
way of testing or debugging when memory goes from shared to unshared in the 
mod_perl environment?

I notice in my processes (using top) that there are several processes that look 
like they have the same memory maps with regards to shared vs. unshared memory, 
then there is the root, and one child that has it's one shared and unshared 
memory allotment. It usually starts with less shared memory than the rest, but 
on every restart the memory usages change so that the shared amounts change 
with each restart, sometimes higher, sometimes lower.

I'm wondering if there is a way to see under the hood so to speak to determine 
what is being shared and what is not in each child process.
Obviously, single user mode type debugging is out.

Any suggestions?

Thank you,
 Boysenberry Payne