[Vm-dev] Changes to memory allocation (FIX)

Igor Stasenko siguctua at gmail.com
Mon Jun 6 12:43:19 UTC 2011


Hello, remember the problem Tudor has on Win32.
I tracked it down to the #sufficientSpaceAfterGC: method.
It looks like it miscalculating the amount of required space , and so the check

	self oop: freeStart + minFree + 15000 isLessThan: reserveStart

fails after growing the memory.
I am not sure how to correctly calculate the amount of required free
memory, so i just put it in loop,
and grow memory until condition met or no free space available).

However, there are still plenty of memory available & address space.
In my test VM, i raised the limit up to 1Gb
and also modified platform files a little to log the numbers it operating with.
Before the change, opening a large image were lead to low-space
warning which hangs the image.
Now, after change, no low-space warning anymore.

So, here the output:

max available memory space: 1073741824 , reserved now: 422965248
allocated extra memory: 4214784 , total: 427180032
allocated extra memory: 4214784 , total: 431394816
allocated extra memory: 4214784 , total: 435609600
allocated extra memory: 4214784 , total: 439824384
sqMemoryExtraBytesLeft returns: 633917440
allocated extra memory: 5914624 , total: 445739008


Before change it was:

max available memory space: 1073741824 , reserved now: 422965248
allocated extra memory: 4198400 , total: 427163648
allocated extra memory: 4198400 , total: 431362048
allocated extra memory: 4198400 , total: 435560448
allocated extra memory: 4198400 , total: 439758848

The image i tried is one, provided by Tudor (about 412 Mb) - there are
link to download somewhere. It shows a low space warning on startup.

The are no functional changes in attached sqWin32Alloc.c/.h . I put
them here just to show how i got the above numbers output.
(except that i raised an address space limit to 1Gb in header).

-- 
Best regards,
Igor Stasenko AKA sig.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NewObjectMemory-sufficientSpaceAfterGC.st
Type: application/octet-stream
Size: 1070 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20110606/e687498b/NewObjectMemory-sufficientSpaceAfterGC.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqWin32Alloc.c
Type: text/x-csrc
Size: 7651 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20110606/e687498b/sqWin32Alloc.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqWin32Alloc.h
Type: text/x-chdr
Size: 1131 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20110606/e687498b/sqWin32Alloc.h


More information about the Vm-dev mailing list