Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak in ruby gem version 3.15.3 and above (including the latest 3.15.7) #8455

Closed
bruno- opened this issue Apr 6, 2021 · 1 comment · Fixed by #8461
Closed

Memory Leak in ruby gem version 3.15.3 and above (including the latest 3.15.7) #8455

bruno- opened this issue Apr 6, 2021 · 1 comment · Fixed by #8461

Comments

@bruno-
Copy link

bruno- commented Apr 6, 2021

What version of protobuf and what language are you using?
Version: 3.15.7
Language: Ruby

What operating system (Linux, Windows, ...) and version?
Tried this on both Mac and Linux. The issue can be reproduced on both operating systems.

What runtime / compiler are you using (e.g., python version or gcc version)

Ruby 3.0.0.

Specific versions:

  • Mac version: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19]
  • Linux version: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]

What did you do?

Use this gemfile:

# filename: gems.rb
source "https://rubygems.org"

gem "google-protobuf", "= 3.15.7"

Use this script:

# filename: test.rb
require "google/protobuf/well_known_types"

loop do
  Google::Protobuf::Value.new
end
  • Install the google-protobuf gem with: bundle
  • Run the script with: bundle exec ruby test.rb
  • Monitor memory usage in htop in another terminal window.

What did you see?

I can observe that program memory usage grows really fast. I reaches 1Gb within a minute and continues to grow fast.

What did you expect to see

I expected the program's memory growth to stop at around 50Mb of memory use.

This happens (memory stops growing) with gem versions 3.15.2 and below.

Anything else we should know about your project / environment

  • I originally reported this to grpc repo (link to issue GRPC Ruby Memory Leak grpc/grpc#25877) but then realized that is probably not the right place.
  • This problem seems to be very similar to Memory Leak in ruby gem version 3.15.3 and above (including the latest 3.15.7) #8455 . There's a comment in that issue claiming the problem was fixed in latest ruby gem version 3.15.7. Unfortunately I was not able to confirm that: the problem described here does happen for me with 3.15.7.
  • I tested various gem versions. This issue does not happen with google-protobuf gem versions 3.15.2 and below.
  • I'm responsive, please ping me and I can provide additional help/clarification etc.
@bruno-
Copy link
Author

bruno- commented Apr 8, 2021

Closing as this was fixed via #8461

Thank you for a quick fix 🙏

@bruno- bruno- closed this as completed Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant