Re: Horrible handler memory leak

2002-12-03 Thread Stas Bekman
Hann, Brian wrote:
 I'm having a problem with a fairly simple handler eating up resources
 and I'm wondering if there's any easy way to track it down.

 The handler fetches data from an Oracle database and displays it
 using Template-Toolkit.  Nothing fancy, just some display logic, etc.


 The thing is, when I try to show all 8000 records the process spirals
 upwards towards 500M and it has to be killed.  With smaller amounts
 of records (~100-1000), the process STILL grows by several megs.
 There really isn't that much data going through other than the sheer
 amount of records so I'm wondering what's eating the resources.

When storing lots of small records in Perl the overhead of the data 
management is very big. You can check the real memory usage with B::Size 
(which can be conveniently invoked via Apache::Status). See 
http://perl.apache.org/ for some examples.

Consider using some other way to represent data in your perl code (e.g. 
dbm files). Also see the list archives for similar discussions.


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Horrible handler memory leak

2002-12-02 Thread Hann, Brian
I'm having a problem with a fairly simple handler eating up resources and I'm 
wondering if there's any easy way to track it down.
 
The handler fetches data from an Oracle database and displays it using 
Template-Toolkit.  Nothing fancy, just some display logic, etc.
 
The thing is, when I try to show all 8000 records the process spirals upwards towards 
500M and it has to be killed.  With smaller amounts of records (~100-1000), the 
process STILL grows by several megs.  There really isn't that much data going through 
other than the sheer amount of records so I'm wondering what's eating the resources.
 
Thanks,
 
Brian Hann



Re: Horrible handler memory leak

2002-12-02 Thread joe
Brian,

Are you trying to read the entire 8000 records into a
single array/hash?  You might try splitting the record
set into pieces and reuse that array/hash.  

-- Joe Palladino

Hann, Brian wrote:

 
 I'm having a problem with a fairly simple handler
 eating up resources and I'm wondering if there's any
 easy way to track it down.
  
 The handler fetches data from an Oracle database and
 displays it using Template-Toolkit.  Nothing fancy,
 just some display logic, etc.
  
 The thing is, when I try to show all 8000 records the
 process spirals upwards towards 500M and it has to be
 killed.  With smaller amounts of records (~100-1000),
 the process STILL grows by several megs.  There really
 isn't that much data going through other than the
sheer
 amount of records so I'm wondering what's eating the
 resources.
  
 Thanks,
  
 Brian Hann