[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] use diagnostics, memory leak?



At 13.34 12/3/97, Xah Lee wrote:
>3. You'll see that each time the memory bar increase about 1M. After about
>3 times, MacPerl will complain out of memory, sometimes auto-exit. Freezes
>OS occationally.
>
>Is this a bug? I'm using 5.1.5r4 on MacOS8.

Are you using this on a PowerMac?  If not, which MacPerl are you using?

I run the script, and the bar does go up, but then it comes back down
within a few second.  Maybe you just need to allocate more memory to
MacPerl so it has a chance to allocate/deallocate the space it needs.

Here is a quick script:

#!perl -wl
use Mac::Memory;
print FreeMem();        #returns amount of free heap space
for(0..10000){
  eval('use English;use strict;use diagnostics;');
}
print FreeMem();

Run it twice in a row, and get:

6500800
5086736
6468000
5053808


And if I add 'use Mac::Memory;print FreeMem();' to the eval, and change the
number to 10, I get:

6434752
5086224
5086224
5086192
5086192
5086192
5086192
5086144
5086176
5086144
5086144
5086144
5086144

Seems to be OK to me.

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch