There's a memory leak in ObjectSpace::WeakMap due to not freeing the struct weakmap. It can be seen in the following script:
100.timesdo10000.timesdoObjectSpace::WeakMap.newend# Output the Resident Set Size (memory usage, in KB) of the current Ruby processputs`ps -o rss= -p #{$$}`end
This is the memory usage graph before and after the patch:
There's a memory leak in ObjectSpace::WeakMap due to not freeing
the struct weakmap. It can be seen in the following script:
100.times do
10000.times do
ObjectSpace::WeakMap.new
end
# Output the Resident Set Size (memory usage, in KB) of the current Ruby process
puts `ps -o rss= -p #{$$}`
end