Accidentally Retaining Head?

2010-03-23 Thread aria42
Hi, I was experimenting with some code and I had an largish sequence I did a doseq over. The memory hit the ceiling, which you expect since even though the head isn't retained GC doesn't happen until you hit your memory limit (is there a way to change that). Once it hit the memory limit, 1.2

Re: Accidentally Retaining Head?

2010-03-23 Thread Per Vognsen
It doesn't seem very accidental: the namespace binding for 'trees' is retaining the head. You probably want to wrap it in a function: (defn trees [] ...) -Per On Tue, Mar 23, 2010 at 9:40 PM, aria42 ari...@gmail.com wrote: Hi,  I was experimenting with some code and I had an largish

Re: Accidentally Retaining Head?

2010-03-23 Thread aria42
Whoops duh. That was silly, far to early on the west coast. On Mar 23, 7:46 am, Per Vognsen per.vogn...@gmail.com wrote: It doesn't seem very accidental: the namespace binding for 'trees' is retaining the head. You probably want to wrap it in a function: (defn trees []   ...) -Per On

Re: Accidentally Retaining Head?

2010-03-23 Thread Per Vognsen
By the way, you seem to misunderstand some of the workings of GC. In the kind of generational scheme used in virtually all modern algorithms, a collection of the nursery (where allocations are first hatched) will only be forced when the memory assigned to the nursery is exhausted--not the memory