Hans:
I am not sure exactly how 'chuck' does memory allocations, but I avoid allocate any reference types in the threads. I have had the program running for long time. Are you saying the threads themselves are leaking?
Essentially, yes: sporking a shred eats up 88.3K of non-recovered
memory. It's easy to show with this bit of code:
=================================
Std.system("ps gauxw | head -1");
// warm up the VM
for (0=>int i; i<10; i++) { 10 => int x; }
<<< "on startup" >>>;
Std.system("ps gauxw | grep chuck | grep -v grep");
10000 => int ntest;
fun void testShred() { }
for (0=>int i; i
On 8 Jun 2009, at 23:20, Robert Poor wrote:
You approach looks just fine for situations where you generate notes at a "musically sensible" rate.
My system isn't musically sensible: I'm generating dozens of "I just modified the end time of your event" messages every second, so sporking a shred and letting it die is not an option -- I'd be burning a megabyte of non-recoverable memory every second.
I am not sure exactly how 'chuck' does memory allocations, but I avoid allocate any reference types in the threads. I have had the program running for long time. Are you saying the threads themselves are leaking?
I suspect Dan Trueman is doing the same thing I'm doing, namely spawning secondary timing shreds as needed, which can be kept around and re-used after they've done their duty.
One idea I have, but haven't tried, is making a thread an event scheduler.
Hans