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

Re: [MacPerl] use diagnostics, memory leak?



Here are the results of running your script that tests memory usage. It seems to me MacPerl is eating memory.

I'm using Matthias' MacPerl 5.1.5r4 without any patches. MacOS8.0. PowerMac 7500/100. MacPerl is assigned 5000k.

I ran the following 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();

Running it twice in a row (~ 10 minutes), I got

3292160
1582768
2077616
729152

compare it to your result:

>6500800
>5086736
>6468000
>5053808

The difference in mine are:
3292160 - 1582768 = 1709392
2077616 -  729152 = 1348464

yours:
6500800 - 5086736 = 1414064
6468000 - 5053808 = 1414192


By your suggestion, if I now run the following script:

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

I got

3766112
1958272
1958272
1958256
1958256
1958208
1958208
1958208
1958208
1958176
1958176
1958176


>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

Do I have a problem on my system? In any case, shouldn't MacPerl free the first 1M?

 Xah
 xah@best.com
 http://www.best.com/~xah/SpecialPlaneCurves_dir/specialPlaneCurves.html
 Mountain View, CA, USA



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