From: Tim Hunter Date: 2007-09-05T04:38:02+09:00 Subject: Re: RMagick: UnableToConcatenateString ` Joel VanderWerf wrote: > Tim Hunter wrote: >> used by individual image objects with the Magick::Image#destroy! method, >> thus eliminating the need to call GC.start from time to time. > > Seems like ruby could help out libraries like RMagick by exposing an API > to tell GC that memory has been allocated by something other than ruby's > malloc. Did anyone ever pursue that? This may help in the general case but for RMagick not so much. RMagick doesn't know how much memory ImageMagick is allocating for an image. Even if it knew or could compute the amount of the initial allocation the amount of memory used for an image can vary over the lifetime of the image. I suppose RMagick could give Ruby an estimate, which might help some. I gave some thought to trying to get ImageMagick to use Ruby's memory management API. It seems like it might solve the problem, but I'm not sure that the IM developers would want to devote that much effort to Ruby users. Adding #destroy! is something I could do on my own. It more-or-less parallels the way you can close files and sockets and otherwise free up resources that Ruby either doesn't know about or might let hang around longer than necessary. -- Posted via http://www.ruby-forum.com/.