soma-prototype
soma-prototype copied to clipboard
Objects, and Promises should not continue to take up memory. (i.e. Need Garbage Collection)
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.
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?
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).