From: Gaffer Date: 2003-05-18T21:39:17+09:00 Subject: Re: ruby garbage collection i think its actually the GC cleaning up matrix and vector classes (my own implementation extended in ruby, they just alloc and free using c++ new/delete operators, matching my c++ classes: vector (float[4]} and matrix float[16]; the slowdowns appear to be caused by the gc collecting at longer and longer intervals, -- initially it works quite well, and it gc's every sec or faster later on it seems to buffer up gc for about 5-10 secs, and takes a good chunk of time each sweep also, i'm not doing any marking myself in c, these are pretty primitive c++ classes, and never ref any other ruby objects, so i just implement the free function ptr for the classes cheers -----Original Message----- From: Simon Strandgaard [mailto:0bz63fz3m1qt3001@sneakemail.com] Sent: Sunday, May 18, 2003 10:30 PM To: ruby-talk ML Subject: Re: ruby garbage collection On Sun, 18 May 2003 22:10:18 +0900, Gaffer wrote: > it seems to work, where calling GC.start from ruby still has the slowdown > for about 10secs, as if some background processing is going on are you marking ruby instances yourself ? can you estimate roughly how many ruby-instances you have ? A: 0 < n < 500 B: 500 < n < 5000 C: 5000 < n < 50000 D: 50000 < n < infinite perhaps you are having a thread which is consuming all time ? maybe pause all threads during GC can help (untested). rb_thread_stop_timer(); rb_gc_start(); rb_thread_start_timer(); -- Simon Strandgaard