logo       

problem with big dictionary: msg#00104

lang.smalltalk.squeak.beginners

Subject: problem with big dictionary

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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise