Actions
Bug #20194
closedMemory leak with TracePoint on bmethod
Bug #20194:
Memory leak with TracePoint on bmethod
Description
GitHub PR: https://github.com/ruby/ruby/pull/9614
When disabling the TracePoint on bmethod, the hooks list is not freed.
For example:
obj = Object.new
obj.define_singleton_method(:foo) {}
bmethod = obj.method(:foo)
tp = TracePoint.new(:return) {}
10.times do
100_000.times do
tp.enable(target: bmethod) {}
end
puts `ps -o rss= -p #{$$}`
end
Before:
After:
Actions