Project

General

Profile

Actions

Bug #19835

closed

Parser leaks memory for incomplete tokens

Added by peterzhu2118 (Peter Zhu) 9 months ago. Updated 9 months ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:114377]

Description

GitHub Pull Request: https://github.com/ruby/ruby/pull/8192

The parser does not free the tbl of the struct vtable when there are leftover lvtbl in the parser. This causes a memory leak.

The following script reproduces this issue:

10.times do
  100_000.times do
    Ripper.parse("class Foo")
  end

  puts `ps -o rss= -p #{$$}`
end
Actions

Also available in: Atom PDF

Like0
Like0Like0