httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <>
Subject Re: Parsing error when parsing the second time
Date Sat, 31 Mar 2007 04:02:47 GMT
Andy Grundman <> writes:

> The APR::Pool docs warn about memory leakage if using a global pool,
> do you think I should be calling $pool->clear after every time I use
> it?

No.  I don't know how you're planning to make use of
APR::Request in a standalone application, but I would
recommend creating a global pool and letting perl
clean it up at program exit.  If you run short of
memory, calling $pool->clear somewhere in the middle
of your program will hose all your APR::Request structs,
so try to avoid that.

You're wandering into largely unchartered territory
by using APR:: outside of mod-perl, so  I would try
to be conservative if possible, and follow the examples 
in the test code. APR::Pool has a good set of tests,
so I'm really not sure the problem is there or somewhere
in apreq's xs.  It just stood out that you were using
a new pool for each subroutine call, which probably
isn't the best way to do things.

Joe Schaefer

View raw message