From: Robert Klemme Date: 2007-11-17T20:49:49+09:00 Subject: Re: REXML memory consumption 2007/11/17, Ray Chen : > My process memory usage has been increasing steadily, and some probing > pointed me to REXML. I created a test that consisted of feeding 10 xml > files ranging in size from 15kB to 270kB to REXML::Document.new(). The > files are fed smallest to largest. I would think that memory usage > should return back to ~8 MB since the REXML::Document should go out of > scope, and everything should get garbage-collected. > > Is there something wrong with my understanding of Ruby or does REXML > hold onto memory? You probably just overlooked that there are two levels of memory management: Ruby's internal MM and the operating system's MM. You just looked at the OS side. While the memory can be released internally this does not mean that Ruby will give it back to the OS. There were more exhaustive discussions of the topic here (meaning ruby-talk) - you'll find them in the archives. Cheers robert -- use.inject do |as, often| as.you_can - without end