soma-prototype icon indicating copy to clipboard operation
soma-prototype copied to clipboard

Objects, and Promises should not continue to take up memory. (i.e. Need Garbage Collection)

Open mjstahl opened this issue 12 years ago • 2 comments

Currently there is no means of garbage collection of objects (or promises). A reference counting system eventually has to be added so that objects and promises that leave scope are sent a "die" message so that the goroutine ends.

mjstahl avatar Feb 25 '13 03:02 mjstahl

A thought for right now.

First off every Value needs a kill channel. Upon receiving a value from this channel, the for loop will be broken, ending the goroutine (and eventually being collected by golang's GC)

But how do we determine determine what needs to be killed?

mjstahl avatar Mar 05 '13 06:03 mjstahl

A simple reference counting mechanism may be all that is needed (we will have to handle cyclical dependencies at a later date). This would also have to be compensated for when doing distributed message passing, as a remote machine may have a reference to a local object (i.e. we don't want to be too aggressive with cleaning up the goroutines).

mjstahl avatar Sep 28 '13 17:09 mjstahl