Return-Path: Delivered-To: apmail-httpd-apreq-dev-archive@www.apache.org Received: (qmail 70313 invoked from network); 31 Mar 2007 04:03:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Mar 2007 04:03:29 -0000 Received: (qmail 39734 invoked by uid 500); 31 Mar 2007 04:03:36 -0000 Delivered-To: apmail-httpd-apreq-dev-archive@httpd.apache.org Received: (qmail 39608 invoked by uid 500); 31 Mar 2007 04:03:36 -0000 Mailing-List: contact apreq-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list apreq-dev@httpd.apache.org Received: (qmail 39592 invoked by uid 99); 31 Mar 2007 04:03:36 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2007 21:03:36 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of gcaa-apreq-dev@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2007 21:03:27 -0700 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HXUnr-0001ns-SA for apreq-dev@httpd.apache.org; Sat, 31 Mar 2007 06:02:59 +0200 Received: from adsl-065-012-220-185.sip.bct.bellsouth.net ([65.12.220.185]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 31 Mar 2007 06:02:59 +0200 Received: from joe+gmane by adsl-065-012-220-185.sip.bct.bellsouth.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 31 Mar 2007 06:02:59 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: apreq-dev@httpd.apache.org To: apreq-dev@httpd.apache.org From: Joe Schaefer Subject: Re: Parsing error when parsing the second time Date: Sat, 31 Mar 2007 00:02:47 -0400 Lines: 25 Message-ID: <87648i5ac8.fsf@gemini.sunstarsys.com> References: <87abxu5bfe.fsf@gemini.sunstarsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: adsl-065-012-220-185.sip.bct.bellsouth.net Mail-Copies-To: never User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:ZeQi2Lqe72GuJQ5YvpeanoPfFOM= Sender: news X-Virus-Checked: Checked by ClamAV on apache.org 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