Bug #5058
closedMemory leak in Psych.load
Description
=begin
I believe there's a memory leak in (({Psych.load})) that affects all long running processes that loads YAML a large number of times.
The expected behaviour is that the memory consumption doesn't grow just because a very simple piece of YAML is loaded and immediately thrown away multiple times.
The easiest way to reproduce it is by executing the following piece of code in irb and look at the memory consumption of the process in a process monitor.
require 'psych'
(1..10000).each {|i| Psych.load "---\nhey\n...\n"}
The two pictures I've attached show what it looks like in my process monitor before and after.
I've run this on Mac OS X 10.6.8.
The compiler is: (({i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)}))
And I've used no ./configure options.
=end
Files