Skip to content

Fix unbounded memory growth for Ruby <2.7.#8429

Merged
haberman merged 4 commits intoprotocolbuffers:3.15.xfrom
haberman:ruby-gc-secondarymap
Mar 29, 2021
Merged

Fix unbounded memory growth for Ruby <2.7.#8429
haberman merged 4 commits intoprotocolbuffers:3.15.xfrom
haberman:ruby-gc-secondarymap

Conversation

@haberman
Copy link
Copy Markdown
Member

Previously our secondary map (needed only on Ruby <2.7) was growing without bound.

This PR adds a periodic GC pass of the secondary map to avoid this unbounded memory growth.

Fixes: #8421

@google-cla google-cla Bot added the cla: yes label Mar 25, 2021
@haberman haberman changed the base branch from master to 3.15.x March 25, 2021 18:49
Comment thread ruby/ext/google/protobuf_c/protobuf.c Outdated
Comment thread ruby/ext/google/protobuf_c/protobuf.c
We now hold the mutex for both map insertions, to protect
against a concurrent GC that removes from the seconary map
before we can insert into the weak map.
@haberman haberman merged commit a38319b into protocolbuffers:3.15.x Mar 29, 2021
@haberman haberman deleted the ruby-gc-secondarymap branch April 20, 2021 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory Leak in Ruby gem as of 3.15.x

3 participants