Return-Path: Delivered-To: apmail-perl-test-dev-archive@www.apache.org Received: (qmail 37361 invoked from network); 8 Sep 2005 19:35:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Sep 2005 19:35:15 -0000 Received: (qmail 19274 invoked by uid 500); 8 Sep 2005 19:35:15 -0000 Mailing-List: contact test-dev-help@perl.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: test-dev@perl.apache.org Delivered-To: mailing list test-dev@perl.apache.org Received: (qmail 19261 invoked by uid 99); 8 Sep 2005 19:35:15 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Sep 2005 12:35:15 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [128.205.250.2] (HELO ubitmail.itorg.ad.buffalo.edu) (128.205.250.2) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Sep 2005 12:35:26 -0700 Received: ubitmailfront.cit.buffalo.edu 128.205.250.2 from 128.205.250.5 128.205.250.5 via HTTP with MS-WebStorage 6.0.6249 Received: 128.205.250.5 128.205.250.5 from via HTTP with MS-WebStorage 6.0.6249 User-Agent: Microsoft-Entourage/11.1.0.040913 Date: Thu, 08 Sep 2005 15:35:09 -0400 Subject: Re: proposed memory size test method From: Jim Brandt To: Message-ID: In-Reply-To: <431491DC.60101@stason.org> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 8/30/05 1:05 PM, "Stas Bekman" wrote: > Jim Brandt wrote: >> The reason I recently ended up diving down the rabbit hole of the >> same_interp_tie method was actually that I was working on writing a >> helper method to watch memory size on a mod_perl process. My >> methodology was simply a brute force series of requests with a memory >> check before and after. > > Also take a look at: > http://search.cpan.org/src/GOZER/mod_perl-2.0.1/t/lib/TestCommon/MemoryLeak.pm Thanks for the pointer. I think my proposed test method attempts to do the same thing as this module, but in quite a different way. To get results from MemoryLeak, it appears you need to add a function call to the top and bottom of your handler. It will then watch your process and dump some nice diagnostics to the error log. For t_mem, I was trying to create a method that would also watch memory, but externally with no code changes. So you can write a standard external test script, not modify your code, and find out if something is leaking on you. I added the tolerance in an attempt to get pass/fail behavior like a normal test, but with some allowance for small variability with memory allocation. Also, I believe t_mem will work on handlers and Apache::Registry scripts, so people converting to mod_perl could use it to watch their converted scripts if they are questionable with memory usage. Jim