On 20 Feb 2002, at 17:02, phinney wrote:

> Hello all...
> 
> I have a DBI call that returns a long list of names (10,000).  I am
> using fetchall_arrayref.  The call seems to take up 40MB of memory.

Is it the perl process or your database consuming the memory?
A list of 10,000 strings (30 characters each) as an arrayref of 
arrayrefs consumes only neglectable memory on my machine. 100,000 
strings consume 17 MB. Play around and check where memory consumption 
occurs by using a row-by-row fetch method instead of 
fetchall_arrayref, and performing your query directly with your 
database.
 
> Is this normal?  Am I doing something wrong?  Is there any special way
> to free up this memory.

AFAIK unused memory is not returned to the system from Perl 
processes. A workaround is to fork() out the memory consuming steps 
into a child process, the memory of which is freed when the child 
exits.

HTH

Bodo




Reply via email to