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
GRPC Ruby Memory Leak #25877
Comments
I can also reproduce this problem. In my case it's more like a memory explosion unfortunately. Here's a really minimal reproduction script: require "google/protobuf/well_known_types"
loop do
Google::Protobuf::Value.new
end With the above script the memory explodes, quickly reaching 1Gb (in less than a minute) and continues to grow steeply. Here's more info about my setup:
Gem versions:
What did you expect to see? For the above provided short script I expected the program's memory use (inspected via What did you see instead? I monitored program's memory use via |
I wanted to see if there are gem releases that are not affected by this memory leak. I used the same script as above: require "google/protobuf/well_known_types"
loop do
Google::Protobuf::Value.new
end and ran this script with a number of The following gem versions did NOT have the memory leak problem: |
I just realized in my case this is a protocol buffers related problem and should probably be reported to that repository. Please ignore my two posts above, I opened a new issue here: protocolbuffers/protobuf#8455 Thank you for working on |
No, I think this issue was fixed, see the protobuf issue protocolbuffers/protobuf#8455 and the related fix protocolbuffers/protobuf#8461 |
Yeah, this issue was fixed. Thanks, @bruno-, and @peterzhu2118 :) |
What version of gRPC and what language are you using?
Master branch, version 1.36.0 with Ruby
What operating system (Linux, Windows,...) and version?
$ uname -a Linux workland 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux
What runtime / compiler are you using (e.g. python version or version of gcc)
What did you do?
Please provide either
What did you expect to see?
When we run Greeter example in GRPC's example folder, we were expecting memory to return to normal state after the operations are completed.
greeterserver.rb` starts with 19.7MB memory at startup.
What did you see instead?
We update
greeterclient.rb
to run100,000
times in order to show the memory leakWhen we run
greeterclient.rb
for the first time, memory jumps to23.8MB
.When we run
greeterclient.rb
for the second time, memory jumps to28.3MB
.When we run
greeterclient.rb
for the third time, memory jumps to36.1MB
.In order to find the source of the memory leak, I have updated the
greeterserver.rb
as follows:After this change, I have updated the
greeter_client.rb
to run 20 times. After only one run, here's the report by memory profiler:We've ran the Memory Profiler 2nd time and here's the report that it had generated:
Anything else we should know about your project / environment?
No.
The text was updated successfully, but these errors were encountered: