aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_open3.rb
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-01-30 10:12:06 -0500
committerPeter Zhu <peter@peterzhu.ca>2024-01-30 16:43:44 -0500
commitdddef93bbd0327e24dff8c87caeb66b6f64800e6 (patch)
treebd8df74abf707725bd68d508598f9079d1e22842 /test/test_open3.rb
parentc1f8d974a848ef379d2beb59064092f2fb59c7ed (diff)
downloadruby-dddef93bbd0327e24dff8c87caeb66b6f64800e6.tar.gz
Fix memory leak in File.expand_path
File.expand_path leaks the dir if the encodings are not compatible. For example: Encoding.default_external = Encoding::UTF_16BE 10.times do 100_000.times do File.expand_path("./a") rescue end puts `ps -o rss= -p #{$$}` end Before: 12288 15488 18656 21872 25056 28240 31392 34688 37856 41056 After: 9680 9728 9728 9792 9792 9792 9792 9792 9792
Diffstat (limited to 'test/test_open3.rb')
0 files changed, 0 insertions, 0 deletions