.------[ Jeff AA wrote (2002/09/04 at 09:34:56) ]------
 | 
 |  I have a Perl script that creates a large hash, from a collection of
 |  files. I am running Perl 5.6.1 on SMP Linux 2.4.18, top shows my process
 |  using up to 700MB of memory (which is fine on our servers). I have
 |  noticed though that when perl hits my 
 |    exit 0;
 |  line, the process pauses for up to two minutes, and pushes CPU
 |  utilisation on one of the CPUs up to >99%
 |  
 |  Any clues? I wondered if Perl was doing garbage collection, or if it was
 |  freeing loads of small chunks of memory or something?
 |  
 |  Is there anything I can do to speed up whatever is going on?
 |  
 `-------------------------------------------------

    It could be garbage collection, but it shouldn't take 2 minutes to
    free() 700MBs of data. Could be that your code is written in such 
    a way that it is having to back out of lots of subroutines and
    free'ing things as it goes? Such as with recursion? 

    Is this 700MBs in one data segment ( i.e. a single hash, array, etc
    ) or thousands of little ones?  

    I could imagine a situation where if you had thousands of little
    variables which are local to some subroutines that are traversed
    recursively it might take Perl that long to back out all of the way 
    free()'ing as it goes. 

 ---------------------------------
   Frank Wiles <[EMAIL PROTECTED]>
   http://frank.wiles.org
 ---------------------------------


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to