From: Joel VanderWerf Date: 2008-01-06T03:25:29+09:00 Subject: Re: Manual Memory Management Marcin Raczkowski wrote: > I would only like to add that RMgick for example provides free method to > release large images if they are not needed, and for me that's good thinkg. > > solution to the above problem might be finding a way to assign Qnil to > all references before forcefully removing actuall value. > > this way we would be able to release for example large file that we > loaded into memory becouse we had to do bunch of regexpes on it. > Or if someone is making image manipulation library in pure ruby it would > be nice to be able to free that 20mb large bmp :] This problem is solved by Nobu's suggestion to use a #clear method, rather than #free the ruby object, isn't it? Nobu Nakada wrote: > What kind of `large' objects? In the case of a large string or > array, just clear its content: > > large_string[0..-1] = "" > large_array.clear > > In the case of an instance of your own class which has many > instance variables, you should add clear method to it. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407