From: Robert Klemme Date: 2005-06-08T23:45:27+09:00 Subject: Re: Memory leak? Nathan Smith wrote: > On Jun 8, 2005, at 10:20 AM, Robert Klemme wrote: > >> Nathan Smith wrote: >> >>> Hello, >>> >>> I get very different results in my program when I add a simple print >>> >> >> What kind of results? Memory usage? Was this the first output >> statement >> in the whole program? > > I have many print statements, although I'll cut them out to see if > anything changes. > >> You probably created some temporary strings for / during printing >> and the >> GC doesn't collect them immediately. > > Aye, I thought of that, but the problem is a little deeper than that. > Objects are being created dynamically, and the actual type of the > object that is created changes -- depending on if I put enough print > statements into the code. It looks and smells like a memory leak..... > :( Wait, you say the type of objects changes and call that a memory leak? This doesn't make sense to me - at least not in the light of the information you have disclosed so far. > Are there any tools that can verify this? Seems like that would be a > problem, considering that Ruby generally doesn't have memory leaks. > Thanks for your help Difficult with GC. You could use ObjectSpace to create some statistics for objects per class or such. robert