summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-01-16 15:22:03 -0500
committerPeter Zhu <peter@peterzhu.ca>2024-01-16 16:19:43 -0500
commit5471f99eead4dd77f1d418eca04d7656bb97f01d (patch)
tree0a14aa98b404dd64ae0082d06a15bbf64240f558 /include
parent7b6731b1bb7c8fab72580f92450eea6e4cc3d943 (diff)
[PRISM] Fix memory leak when compiling file
There is a memory leak when passing a file to RubyVM::InstructionSequence.compile_prism because it does not free the mapped file. For example: require "tempfile" Tempfile.create(%w"test_iseq .rb") do |f| f.puts "name = 'Prism'; puts 'hello'" f.close 10.times do 1_000.times do RubyVM::InstructionSequence.compile_prism(f) end puts `ps -o rss= -p #{$$}` end end Before: 27968 44848 61408 77872 94144 110432 126640 142816 159200 175584 After: 11504 12144 12592 13072 13488 13664 14064 14368 14704 15168
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions