-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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 protobuf library... #9384
Comments
Hi Anash, when replicating it seems the memory leak originates ~lines 17-21 when we access the field from the response protobufs (whether or not we print and thus convert to string does not seem to make a difference). Memory profiling does not show a leak in overall allocated/returned bytes when this part is removed, so I think we can rule out the However, I did also notice that after adding a manual garbage dump per the code below, the memory profiler no longer shows any increase in allocated memory by gem for There does still seem to be an increase in the total allocated/retained bytes. Can you confirm if you're able to repro this, and confirm whether the leak might not be in protobuf itself? Note that Code:
Results (with GC):
I'm not certain what's up with the "other" allocated memory by gem but I think it might correspond to get_campaign_1x_gc.log |
Given no response for a while I'm going to close this issue, but feel free to reopen it if you're still facing the issue. |
We will follow up internally. xfx@ is on paternity leave and switching teams, so we need to push this to next quarter. |
@zhangskz just so you know, you can't use Ruby memory profilers to check wether E.g. for
So all these objects will report being 40 bytes when in reality they are much much bigger. |
While profiling the Google Ads API Ruby library, we noticed that there are memory leaks with the Ruby protobuf library. The findings (go/ruby-protobuf-leak) and the credentials to replicate the issue has been shared internally with Josh H. This can be replicated independently if you have access to Google Ads API (that's a reasonably high entry barrier, which is why I shared the creds for my test account with Josh H for easier replication). You need to follow the instructions at https://github.com/googleads/google-ads-ruby/blob/HEAD/README.md, then run test.zip attached with this bug.
test.zip
The text was updated successfully, but these errors were encountered: