Skip to content
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

Memory leak with long-running processes #2002

Closed
rkojedzinszky opened this issue Mar 13, 2022 · 3 comments · Fixed by ploxiln/paramiko-ng#133
Closed

Memory leak with long-running processes #2002

rkojedzinszky opened this issue Mar 13, 2022 · 3 comments · Fixed by ploxiln/paramiko-ng#133

Comments

@rkojedzinszky
Copy link
Contributor

Paramiko stores thread-ids in a dictionary, which never gets cleaned up. In a long-running process, this leaks memory. One example is https://github.com/truenas/zettarepl which runs persistently in a TrueNAS system, and thus leaks memory.

The leaking structure is here: https://github.com/paramiko/paramiko/blob/main/paramiko/util.py#L228

@modkasikornline
Copy link

Thumped up to this MR since I've faced the same issue when I tried to transfer 10k files (~300 KB/file) to a server. Memory leaks a lot.

bitprophet added a commit that referenced this issue Mar 18, 2022
bitprophet added a commit that referenced this issue Mar 18, 2022
bitprophet added a commit that referenced this issue Mar 18, 2022
ploxiln pushed a commit to ploxiln/paramiko-ng that referenced this issue Jun 7, 2022
Avoid leaking memory by only ever adding to the thread IDs dict.
Fixes paramiko#2002
@stuartonyx
Copy link

Has there been any resolution to this because we have a use case where we are creating and removing many connections a day and the result has been a memory leak that means we are having to force a reboot every day

@stuartonyx
Copy link

I take it there has been no progress with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants