-
Notifications
You must be signed in to change notification settings - Fork 69
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
Binary leaking in h2_connection processes #120
Comments
If you call for a manual garbage collection of the process, do these go away? If so the leak is probably fixable through well-placed hibernation calls more than anything else. |
I did a |
If you can see them in the crash dump, they were really being held in memory by the process. If they are gone, that's because the VM ran a GC before writing them to the dump. |
Ok, calling the |
That can work temporarily. I think the ideal fixes in these cases for now is to modify the risky processes to run hibernation tasks from time to time when they get downtime so they force this on their own. |
It is also interesting that
|
Looking at this again, if it makes sense we could add a Suggestions for what a good timeout would be? |
Did anyone find the issue with the leaking memory? I have the same problem, the
I'm using chatterbox via grpcbox. |
Yeah the post before yours does mention a possible remediation to hibernate when idle. Someone likely just needs to go and implement it. |
So we have been tracing and found out that the client responses are only cleaned up from the For instance What do you think? |
The grpcbox client doesn't call it because it is getting the body from messages to the client pid, right? If that is the case then it sounds more like chatterbox should have a mode that it keeps the response until it is requested and another where it only sends to some pid. |
yes, there seem to be two flows in h2; one with asynchronous bangs to a notify pid, and one with some synchronous parts. might be a good idea to split them up in two, or clarify which is which. we went with an easy quick fix which I will try to test tomorrow. Basically just added |
Yea, pretty sure the notify a pid flow was added on as a quick hack at the time. Definitely could use some cleaning up. |
Looking at this again. As far as I can tell from the code the only time frames are added to the queue that becomes the response body received is if the callback is undefined. So I don't get how the response body is built up if this is the case. |
Adding a hibernate_after option to h2_connection, but also merged a fix for terminating grpc streams and that may help, not sure, tsloughter#15 |
I use chatterbox as a dependency of the inaka/apns4erl project. After some hours of running of the application I faced with ever growing process sizes (process_info(pid, memory)). Did some investigation I found this:
Do you have a clue where this binary leak can occur?
The text was updated successfully, but these errors were encountered: