-
Notifications
You must be signed in to change notification settings - Fork 637
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
Fix high memory usage of PeerManagerActor:: add_route_back #3508
Comments
@bowenwang1996 @SkidanovAlex Should we decrease ROUTE_BACK_CACHE_SIZE? |
@mfornet is this expected? |
I don't doubt it. We are currently relying in this cache for most of the routed messages! In the short term, if this is a pressing issue, it should be safe to decrease the size of the cache temporarily, it is very likely that oldest entries are messages from peers that are currently disconnected. |
Okay let's shrink the size to 100k then. @mfornet this shouldn't cause any performance issues right? |
No, it should be fine! |
While investigating memory leaks in Rust code I noticed that memory usage by PeerManager keeps growing.
PeerManager leak is within: (rust)func chain/network/src/lib.rs <near_network::peer_manager::PeerManagerActor as actix::handler::Handler<near_network::types::RoutedMessageFrom>>::handle 5577784d767f: 38.31MiB/22467
After 8-10 hours I saw 22k allocations, which were 38mb total. All those allocations are caused by PeerManaagerActor::routing_table.add_route_back. ROUTE_BACK_CACHE_SIZE size is limited to 1m, which means that by the time it becomes full, it will use around 1.7gb of memory, which is suboptimal.
The text was updated successfully, but these errors were encountered: