Re: core.async go - out of memory

2013-07-06 Thread MikeM
On Saturday, July 6, 2013 4:01:31 PM UTC-4, tbc++ wrote: > > Go blocks are GC'd but not until they complete running. The problem is > that you're creating go blocks faster than they can run. Creating go blocks > is very cheap, taking/putting into channels is also cheap but not quite as > cheap

Re: core.async go - out of memory

2013-07-06 Thread Laurent PETIT
2013/7/6 MikeM : > Got an out of memory when experimenting with core.async channels in go > blocks. The following is a simple example. > > (defn go-loop > [] > (let [c0 (chan)] > (while true > (go > (>! c0 1)) > (go > (println ( > ;(.start (Thread. go-loop)) > > Clojure 1.5.1, Java 1.7

Re: core.async go - out of memory

2013-07-06 Thread Timothy Baldridge
Go blocks are GC'd but not until they complete running. The problem is that you're creating go blocks faster than they can run. Creating go blocks is very cheap, taking/putting into channels is also cheap but not quite as cheap. Therefore the outer loop will eventually allocate so many blocks that

Re: core.async go - out of memory

2013-07-06 Thread MikeM
On Saturday, July 6, 2013 11:46:51 AM UTC-4, David Nolen wrote: > > This isn't a bug, you're in a infinite loop constructing go blocks. You > should probably move the loops into the go blocks. > > I assumed go blocks are garbage collected when they go out of scope, but maybe I don't understan

Re: core.async go - out of memory

2013-07-06 Thread David Nolen
This isn't a bug, you're in a infinite loop constructing go blocks. You should probably move the loops into the go blocks. David On Sat, Jul 6, 2013 at 7:31 AM, MikeM wrote: > Got an out of memory when experimenting with core.async channels in go > blocks. The following is a simple example. > >