Plamen Stojanov <[EMAIL PROTECTED]> writes:

> I load 2Mb data from a database in perl hash and perl takes 15Mb
> memory. As I use this under mod_perl - perl never returns this
> memory to the OS. I must set a little number for MaxRequestsPerChild
> in order to restart perl interpreter not to eat a lot of memory.  Is
> there any solution to avoid such memory usage?

Simple: dont load this into memory. You can achieve this in multiple ways:
- (if you really need to get this as hash) use DBM hash, mapping those
  resources to disk instead of memory
- (if you can reconsider) use your database to sort the data according
  to your needs and just process it incrementally (for instance just
  scan record-after-record, do not keep the data in memory but just
  print them to the output socket)


-- 
( Marcin Kasperski   | A reusable framework that is developed by itself will )
( http://www.mk.w.pl |        probably not be very reusable. (Martin)        )
(----------------------------------------------------------------------------)
( Dokument biznesowy w LaTeXu: http://www.mk.w.pl/porady/latex/mkofficial_cls)

Reply via email to