On Mon, Dec 02, 2002 at 03:27:17PM +0900, Squidster wrote: > class Array > def clone > klone = [] > v = nil > self.each { |v| klone.push(v.clone) } > return klone > end > end > > This works very well, but consumes memory like crazy and within 10 > minutes my 1GB machine is already swapping (eats about 2MB per > second)!! 1) Please do not do this, especially in library code. If you redefine Array#clone, you will break someone's code. It's preferable to pick another name for your method, and if possible, move it outside of Array (since this method can be used with more than just arrays). 2) I suspect that the reason you are consuming memory is somewhere else and is not in this method, since the method does nothing but copy the array. What is the size of the array that you are cloning, and how many arrays are you cloning? What other information can you give us that might be helpful? Paul