-
Notifications
You must be signed in to change notification settings - Fork 226
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
Buffers held by protobuf reader/writer use significant memory #322
Comments
Thanks. I can take a look at this one. |
@whyrusleeping I'm not able to reproduce that specific user, do you want to send through the profiles, here or privately? Is mars running the most recent release? What I do find is that
|
@anacrolix hrm... i've restarted the node since then and can't reproduce. I started using the datastore peerstore stuff and its changed up everything. |
The issue is in Line 70 in 080cd52
|
The largest messages tend to be PUT_VALUE, with a 99th percentile of ~992 bytes. I wonder if the buffers can be reduced further to ~1KB, or some value related to that. |
Ideally, we'd use a tiny buffer to read the message size and then a larger buffer to read the actual message. |
Allocate them as-needed and use a pool. Work towards #322.
Allocate them as-needed and use a pool. Work towards #322.
Half of this has now been taken care of. The next part is to fix readers. |
Allocate them as-needed and use a pool. Work towards libp2p#322.
I'm noticing the highest usage of memory on mars right now is coming from the gogo protobuf readers and writers (they are first and second highest user of memory respectively).
I can provide the memory profiles here if needed, but this one seems pretty straightforward.
The text was updated successfully, but these errors were encountered: