-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
FluentFTP.GnuTLS possible memory leak #1579
Comments
Thanks for reporting this.
This is important information
Not surprising
See next...
Well, the idea was to keep the functions loaded (forever) but to initialize and deinitalize the GnuTLS binarys when they are no longer in use. Certainly there may be a logic error in the code somewhere - probably Dispose(). If you have a reproducible mini-console-app that eats memory, let's isolate the problem step by step. |
Hi, I tried to create a Docker environment to test this and I think I managed to reproduce the issue: https://github.com/validide/FluentFTP.GnuTLS At the moment the application tries to connect to the server but fails with an exception. After running for 1000 iterations (just creating the client and trying to connect) it gets up to 3GB RAM consumed on my local setup. I have 0 experience working with FTPS so I am not sure if this test is correct. |
Also Hi! I had a look at your source:
Can you try this with "await using"? and report back? Using "just using" takes things down a different path on dispose (although I thought I was successful in catching this). |
Sheesh. All is good, you are on the track of something perhaps. |
Also, it would be worth dockering a test with SYNC client - because actually FluentFTP.GnuTLS does not really support async operations. I was hoping it would gracefully block if used in an async environment - but it would be nice if you would see if there is a difference. |
Hi, I just pushed an updated version on my repository and there seems to be no difference between the sync and async version. |
Good - we'll concentrate on the SYNC version first in order to determine more. |
When running the project in WSL it seemed like it was leaking 3MB each time it would try to connect. I will try to come-up with better "evidence". |
Yes, that would be nice. I am running some ultra long interations also whenever I have the opportunity. Note please, that it is also entirely possible that the called external non-managed library might also have a memory leak itself - since we keep it loaded instead unloading and reloading (big overhead). |
FTP Server OS: Unknown
FTP Server Type: Unknown
Client Computer OS: Debian
FluentFTP Version: 50.0.1
FluentFTP.GnuTLS Version: 1.0.30/1.0.31
Framework: .NET 7
Hi, I am working on an app that periodically connects to customer FTPS server and downloads some files (using the
FluentFTP.GnuTLS
package). Everything works well apart for increased memory usage in over time (days). After taking some memory dumps it seems that the unmanaged memory is the one that keeps increasing.I can not provide any logs at this time but I will try to generate a sample project to reproduce the issue.
I have looked in the
FluentFTP.GnuTLS
and repository and I saw that the FunctionLoader.Free() call has been removed and that function is not called anywhere else. Could this be the cause of the issue?I know there is not that much information in the issue.
The text was updated successfully, but these errors were encountered: