> -----Original Message-----
> From: Sander Striker [mailto:[EMAIL PROTECTED]
> Subject: Re: Pools, C++, and Exceptions Best Practices
> 
> You'll be eating through your available memory at a pretty quick rate
> this way.  Each pool preallocates 8k.  In your case this means that
> every object you instantiate, you allocate 8k.

Does APR allocate 8k per root memory pool, or for subpool?  When I destroy a
subpool does it recycle the memory?

So, for example, how much memory (roughly) would the following code
allocate:

# apr_pool_t *root, *sub0, *sub1;
# apr_pool_create( &root, 0 );
# apr_pool_create( &sub0, root );
# apr_pool_destroy( sub0 );
# apr_pool_create( &sub1, root );

Basically, does a pool grow infinitely until it's destroyed, or does it
recycle subpool memory?

-david


Reply via email to