<br><br><div class="gmail_quote">2010/9/6 Tambet <span dir="ltr"><<a href="mailto:qtvali@gmail.com">qtvali@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi again!<br></blockquote><div><br></div><div>Hey Tambet!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>As Chuck lacks garbage collection,</blockquote>
<div><br></div><div>Well.... There is a partially implemented garbage collector, based on reference counting. Sometimes it works, sometimes it doesn't, sometimes it's count is off and objects disappear. Primitives (like int, float....) should be freed once their scope seizes to exist. </div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> it's probably The language, which needs a manual about garbage collection - I mean, a manual about lack of it.<br>
</blockquote><div><br></div><div>Maybe, What we need is GC to be finished, then documented.</div><div><br></div><div>First of all; given a more or less typical modern system CPU cost will be a much bigger bottleneck than memory. Unchuck UGens you no longer need from their connection to the dac and/or blackhole and they won't take cpu any more. Have unused Shreds exit or simply reach the end of their code. </div>
<div> </div><div>If you really want to manually remove objects you no longer need you can do this;</div><div>null @=> my_object;</div><div><br></div><div>That should force it to be collected. I'm not sure that also affects UGens but I am sure (as I just tested) that this won't affect currently connected UGens.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>Googling "chuck programming garbage collection" gives these pages:<br>

<ul><li>The Ultimate Top 25 Chuck Norris “The Programmer” Jokes</li><li>Chuck Esterbrook: Geek of the Week</li><li>Java Programming - Hump Day OT</li></ul></blockquote><div><br></div><div>Yes, this is a rather arcane field. GC is turning out to be harder than anticipated, or so it seems.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">It would be good to know, how much memory things take, how to keep memory from growing full etc.</blockquote>
<div><br></div><div><br></div><div>On Unix you can run "top" or some recourse monitor that you may have. On Windows there's the task manager which should show how much memory you are using. In practice I've only once seen this come close to becoming a issue and that involved non-realtime rendering  of a ray-tracing reverb which in one (misguided) design used tens of thousands of shreds. If this become a real issue that you actually have we could look at your code and see what optimizations could be made.</div>
<div><br></div><div><br></div><div>Don't get me wrong; we do need GC and leaks will be a issue for applications like installations that need to run unattended for a long time using many samples, but for most applications on a system build in the past 5 years you should be fine.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> For example - if I close something, will it release memory?<br><font class="Apple-style-span" color="#888888"><br>
</font></blockquote><div><br></div><div>Could you give a example of closing something? I'm not sure what you mean.</div><div><br></div><div>Yours,</div><div>Kas.</div></div>