A problem with standardTime:
John M McIntosh
johnmci at smalltalkconsulting.com
Tue Feb 19 01:40:57 UTC 2002
standardTime: aBlock
"Times the execution of aBlock in milliseconds, under the
following standard conditions: exactly 10Mb of free space is
available and compacted, and the recent VM statistics are reset
immediately before execution."
| spaceLeft tieDown |
spaceLeft _ Smalltalk garbageCollect.
spaceLeft < 1e7 ifTrue: [self error: 'not enough space for
standard conditions'].
tieDown _ ByteArray new: spaceLeft - 1e7. "Leave exactly 10MB free"
Now the problem comes in when the VM can autosize, but the autosizing
doesn't take Virtual Memory considerations into account. The
Smalltalk garbageCollect
returns the maximum size we can grow to, versus say a size that won't
cause page swapping.
So on my mac this returns
517759868
As you can see we then run off and allocate 517759868 - 10000000.
But on a machine that only *has* 512MB of memory, lots of things are
paged out and a historically significant event called *page
thrashing* occurs.
Now I think Dan wrote this, and perhaps it needs to be rethinked.
I'm not sure on unix machines you can really ask what the 'safe'
limit it, after all the objective of VM operating systems is to allow
you to run applications that don't fit into real memory boundaries.
So I'll welcome a change set
Also the max size is used in
ImageSegment>>copySmartRootsExport: rootArray
for some decision on characteristics of an algorithm to be run.
--
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
===========================================================================
More information about the Squeak-dev
mailing list
|