From: gregarican Date: 2006-02-27T10:48:35+09:00 Subject: Re: Memory Question Minkoo Seo wrote: > Eric Hodel wrote: > > On Feb 26, 2006, at 1:51 AM, zdennis wrote: > > > Ruby does not feature a compacting garbage collector so you may > > simply have a lot of nearly-empty pages of memory that cannot be > > returned to the operating system. > > > > What? Is this true? It's quite disappointing. Is there any master plan > in the ruby language for supporting compacting GC? > > - Minkoo Seo I have personally seen similar behavior. I have a Win32 Ruby CTI listener process (based on the library of my http://tsapi.rubyforge.org project) that I leave on my desktop 24x7 that serves like a caller ID box for incoming phone calls to my extension. The looping script I have sleeps 1 second each iteration to help keep the CPU from maxing out. All I am doing is polling an event queue on the CTI server every second. Not sure about what GC'ing would be going on behind the scenes since the objects stay in memory due to the looping construct. But after about a day or so the memory utilization starts to get to about 24 MB. Then after a few more days it tops 40 MB. If I don't restart the script I see problems with other NTVDM processes running alongside it. Perhaps I need to explicitly open/close the sockets each pass?