You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Steven Lembark <le...@wrkhors.com> on 2001/06/04 03:33:13 UTC

Re: Memory leak

> > script offers database search facilities on the web. If a search is
> > performed which results in many (namely 400) rows being returned, then
> > the httpd child that serves the request grows by 2 MB. Have a child
> > serve that request ten times, and its size will grow from an initial 8
> > MB to 28 MB. Another ten times and it will go to around 50 MB.

Depending on how the return is processed this looks more like
an unused reference left behind.  You might want to try, e.g., 
calling the handler from a harness and see where the memory is
going in the debugger.  

It also depends on how the rows are being retrieved.  If you
are in a while( nextrow ) loop vs. a for( fetchall_arrayref )
type the memory use gets pretty large.

Depending on the size of your queries this could also just be
perl's buffering the input. Remember that perl doesn't free
the space it uses but keeps it internally for later use. If you
are running large enough queries over time the memory use will
track the high-water mark of the rows returned (which obviuosly
pertaint to fetchall-type returns).  If the queries get large
enough you can suck up lotsaMB.

-- 
 Steven Lembark                                   2930 W. Palmer St.
                                                 Chicago, IL  60647
 lembark@wrkhors.com                                   800-762-1582