From: Sebastian probst Eide Date: 2007-05-25T23:35:39+09:00 Subject: Re: Memory leak Sebastian probst Eide wrote: > Peter Hickman wrote: >> Why is it inside a while loop? >> >> Aren't you just creating hundreds and thousands of db connections? > > Well, now, not really. I am closing the connections I am making which > should make it all right? Although having the connection part outside > the loop probably would make sense... But I am going to have the program > pause at certain intervals and didn't want to have any open > connections... that is why I tried it like this... But opening and > closing a connection shouldn't make the process memory consumption grow, > should it? > Well... ofcourse you were right. Moving the loop into the begin clause made the program a lot faster and lowered the memory consumption. -- Posted via http://www.ruby-forum.com/.