rqbit icon indicating copy to clipboard operation
rqbit copied to clipboard

Will using a timeout with `session.add_torrent()` + `list_only` cause issues?

Open sylv opened this issue 10 months ago • 1 comments

I have an issue that might be a memory leak or might just be rqbit holding too much information or might just be me being an idiot. I have rqbit with add_torrent() + list_only wrapped in a tokio timeout for 10s running on a VPS to grab torrent metadata - that works well, but over a few hours the memory usage slowly creeps up until the host runs out and everything has to be restarted. It isn't by much, maybe ~400MB/hour. I'm checking probably >2000 torrents an hour.

Is there anything that could cause that slow usage increase in rqbit? I don't know rust well enough to know for sure but I think its either the timeout causing something to not be cleaned up properly (seems unlikely with list_only unless its peer info?) or its holding onto information from each torrent that slowly builds up over time as it sees more and more. Or something to do with DHT...? I'm pretty much lost though. I know this is an unconventional use case so something like that seems likely to me but I don't know rqbit internals well enough.

sylv avatar Jan 16 '25 04:01 sylv

It is possible it's rqbit. Your usage sounds fine, I'll take a look

ikatson avatar Jan 16 '25 09:01 ikatson