atomashpolskiy / bt

BitTorrent library and client with DHT, magnet links, encryption and more
https://atomashpolskiy.github.io/bt/
Apache License 2.0
2.42k stars 381 forks source link

[BUG] A memory leak appears to have been found #164

Closed yjs112233 closed 3 years ago

yjs112233 commented 3 years ago

First, my requirement is to deploy it to the server to receive every task sent by the user. When I was developing in the demo way, I found that I could not re-download the same seed resource.So what I did was to create a BtRuntime and BtClient for each task and to make sure that the Btruntime resource was recovered by shutdown at the end of the task. Everything was working fine until I noticed a "Too Many Open Files" on the Linux server. When I restart the application after all is normal, but "ll/proc/pid/fd | wc -l" query results are always increasing. I exported the contents of the fd folder and found that there are more and more socket and pipe files that were not released. so, Is this the memory leak it produces? Or, are there any good analytical methods to locate the problem? I'm using version 1.9. Hoping for help. Thanks !