rakshasa/libtorrent — Issue #5: Using up too much memory for peers
Author: SineSwiper
Created: 2011-12-19 18:22:25+00:00
State: open

The libtorrent/rTorrent suite is still using too much memory when faced with a moderate amount of torrents and peers. After something like 500 total connections, it reaches around 3GB of RAM. Compared to uTorrent using at most 200MB of RAM for the same situation.

Based on what little I can parse from the C++ code, it appears that libtorrent is still allocating a chunk's worth of memory per peer. There's really no need to allocate the memory as soon as the peer is connected, especially since most peers just sit there and don't do anything. It should only allocate the memory when the peer is actually transferring data. If the chunk isn't useful as a cache hit, then the memory should be de-allocated when the peer isn't talking again.