You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tracker stores all torrents with peer information in a hashmap. This hashmap grows and shrinks depending on the amount of torrents and peers it holds.
Problem:
After the inactive_peer_cleanup_interval, the tracker deletes all inactive peers and empty torrents from the aforementioned hashmap. This means that theoretically the hashmap can shrink from 10,000,000 torrents to 0. The problem is that the hashmap only allocates more memory as it grows, but doesn't free this memory when it shrinks.
So apparently it is expected behaviour to keep the allocated memory of the OS even though it is not being used. I could not find a way to free this memory back to the OS.
We also don't want the hashmap to grow beyond the memory available from the OS. So maybe we should give the hashmap a configurable fixed size and replace the most inactive torrent with the newly announced torrent when the hashmap is full during an announce request.
torrust-tracker/src/tracker/tracker.rs
Line 225 in 065ca80
Should also resize the torrents BTreeMap after torrent cleanup, so that it can release unneeded memory allocation back to the OS.
The text was updated successfully, but these errors were encountered: