[Newbies] problem with big dictionary

Petr Fischer petr.fischer at praguesoft.cz
Wed Oct 18 12:35:42 UTC 2006


Hi, what is wrong with this code:
-----
cnt := 5000000.
s := ' jasdfh afhahkjasdf asdf sd'.
d := Dictionary new: cnt.
1 to: cnt do: [ :i |
	d at: i put: (i asString, s).
	(i \\ 50000 = 0) ifTrue: [ Transcript show: i; cr. ].
].
d size.
-----

Squeak (latest 3.9) hangs randomly after 600 000 - 1 000 000 iterations
(about 129MB of RAM [2GB] used before hang).

hang = white squeak window, no interaction possible, 100% of cpu usage

Thanks for suggestions, pf



More information about the Beginners mailing list