mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
![]() If an exception is raised the FBuffer is leaked.
For example, the following script leaks memory:
o = Object.new
def o.to_json(a) = raise
10.times do
100_000.times do
begin
JSON(o)
rescue
end
end
puts `ps -o rss= -p #{$$}`
end
Before:
31824
35696
40240
44304
47424
50944
54000
58384
62416
65296
After:
24416
24640
24640
24736
24736
24736
24736
24736
24736
24736
|
||
---|---|---|
.. | ||
depend | ||
extconf.rb | ||
generator.c | ||
generator.h |