[Vm-dev] Problem with #garbageCollect and -memory parameter

John M McIntosh johnmci at smalltalkconsulting.com
Wed Dec 1 01:09:15 UTC 2010


If you are compiling your own macintosh VM then go look at 
sqSqueakOSXApplication.m

- (NSInteger) parseArgument: (NSString *) argData peek: (NSString *) peek {
...
	if ([argData compare: @"-memory"] == NSOrderedSame) {
		gMaxHeapSize = (usqInt) [self strtobkm: [peek UTF8String]];
		return 2;
	}
	return 0;
}

and follow the bouncing gMaxHeapSize to see what happens. 
You'll find the use at
	 startOfmmapForANONMemory = mmap(startOfAnonymousMemory, freeSpaceRoundedUpToPageSize, PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED,0,(off_t)0);

in sqMacV2Memory.c


On 2010-11-30, at 5:03 PM, David T. Lewis wrote:

> 
> On Wed, Dec 01, 2010 at 12:41:44AM +0100, Mariano Martinez Peck wrote:
>> 
>> On Wed, Dec 1, 2010 at 12:11 AM, Mariano Martinez Peck <
>> marianopeck at gmail.com> wrote:
>>> 
>>> On Tue, Nov 30, 2010 at 5:14 PM, David T. Lewis <lewis at mail.msen.com>wrote:
>>>> 
>>>> I'm away and cannot check this right now, but if you look in the
>>>> SqS/VMMaker archive there there are a number of recent updates that
>>>> may address this problem. See the Montecello update comments for
>>>> VMMaker-dtl.188, VMMaker-dtl.199, and VMMaker-dtl.200 for summaries.
>>>> These updates would not be in any of the released VMs at this point,
>>>> but I have a hunch that they will take care of this problem.
>>>> 
>>> 
>>> Hi Dave. Ok...after a couple of hours I could compile a new VM for MacOS
>>> with VMMaker 205 and integrating all my changes :)
>>> So....this was something I have to do since several months already hehhehe
>>> 
>>> Now, as you guessed, something  was related to that. Now, these are the
>>> results:
>>> 
>>> normal:
>>> 
>>> Smalltalk garbageCollect   481957728
>>> Smalltalk primBytesLeft 5738200
>>> 
>>> with -memory 1500m
>>> 
>>> Smalltalk garbageCollect    482093452
>>> Smalltalk primBytesLeft 6444200
>>> 
>> 
>> mmmmmmm  if instead of sending -memory I modify Info.plist  and I set
>> 1572864000  (1500gb)
>> then I get
>> 
>> Smalltalk garbageCollect  1518058920
>> Smalltalk primBytesLeft 5898636
>> 
>> :)
>> 
>> so maybe the mac vm is not taking into acount -memory but it does the file?
> 
> Well that's as good a theory as anything I could have made up ;-)
> 
> To be serious, the -memory parameter is part of the unix VM, and
> other platforms may do things differently. So yes, I think you
> have found the right explanation.
> 
> Dave
> 
> 

--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================






More information about the Vm-dev mailing list