And poof it was gone!

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

And poof it was gone!

Ian Bartholomew-19
(Catchy subject line eh! :-) )

Just one of these interesting situations I seem to get myself into from time
to time ....

Evaluate the following in a workspace and then sit back and wait.  If your
system behaves like the two I have tried it on then about 9 seconds later
(on the next GC) Dolphin disappears, no errors - it just shuts down.

x := nil.
MemoryManager current collectGarbage.
Transcript print: MemoryManager current objectCount; cr.
x := LinkedList new.
600000 timesRepeat: [x add: Link new].
Transcript print: MemoryManager current objectCount; cr; cr

You can hasten the end by re-evaluating the first line again.

I initially thought it was the same problem I saw before, running out of
Objects, but it only appears to be using around 700000 so that isn't it.
Something to do with the way the garbage collector compacts maybe....

It's not a great problem (who uses LinkedLists with over half a million
entries!) but it made me blink a bit when it first happened.

Windows XP, Dolphin 5.1.4 (clean) and 512 meg of memory.

--
Ian

Use the Reply-To address to contact me.
Mail sent to the From address is ignored.


Reply | Threaded
Open this post in threaded view
|

Re: And poof it was gone!

Chris Uppal-3
Ian,

> x := nil.
> MemoryManager current collectGarbage.
> Transcript print: MemoryManager current objectCount; cr.
> x := LinkedList new.
> 600000 timesRepeat: [x add: Link new].
> Transcript print: MemoryManager current objectCount; cr; cr

Confirmed on a WinXP Pro box.

On a W2K box, comes up with application error popop:
    unknown exception 0xC00000FD at location 0x10009C8B

which VC++ interprets as a stack overflow -- unsurprisingly.


> It's not a great problem (who uses LinkedLists with over half a million
> entries!) but it made me blink a bit when it first happened.

So how *did* you happen across this one ?

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: And poof it was gone!

Ian Bartholomew-19
Chris,

> So how *did* you happen across this one ?

Fair question :-)

I was just doing some benchmarking.  I've written a little simulation (for
want of a better word) that creates a collection of objects, of
indeterminate size, and then uses that collection as the seeds in generating
another larger collection &etc.  I was just wondering if using a LinkedList
to store the collections, which looks as if it might have less overhead per
added entry, was a better choice than OrderedCollection.  FWIW, even without
the problem I came across it looks like LinkedList isn't any faster than
OrderedCollection. :-(

--
Ian

Use the Reply-To address to contact me.
Mail sent to the From address is ignored.