[squeak-dev] The Trunk: KernelTests-ar.117.mcz

Bert Freudenberg bert at freudenbergs.de
Sat Dec 5 12:37:35 UTC 2009


On 04.12.2009, at 23:18, commits at source.squeak.org wrote:
> 
> + testOutOfMemorySignal
> + 	"Ensure that OOM is signaled eventually"
> + 	| sz |
> + 	sz := 512*1024*1024. "work around the 1GB alloc bug"
> + 	self should:[2000 timesRepeat:[Array new: sz]] raise: OutOfMemory.

So this allocates 2 GB arrays. But since it does not hold onto each array, why should it make a difference if you repeat it one or 2000 times? I mean, provided the garbage collector is doing its job, it should work the same for any number of iterations, right?

I just tried

	100 timesRepeat: [Array new: 100*1024*1024]

which works without raising an error. After this, Squeak slows to a crawl, but it does continue at maybe 1 fps (Etoys 4.0, Mac VM 4.2.2b1). The Mac OS activity monitor says it's spending 80% in markAndTrace(). So the GC doesn't like this at all - but it does work.

- Bert -




More information about the Squeak-dev mailing list