-
Notifications
You must be signed in to change notification settings - Fork 93
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
memleak during multiple file upload when authentication is required #24
Comments
thanks for reporting. i'll take a look. |
i took a look inside your code and ours. we don't use a global state or caching or something else, therefore GO should collect all memory. if some memory gets collected it's still available to the the application, so the application can use it again without acquire more from the system, which is much cheaper. you can force it by calling FreeOsMemory |
Thanks! I'll take a look at "runtime/debug" to dig deeper into this issue and probably collect some more data. However it still seems a bit strange that:
Anyway, I'll play a bit with tools from "runtime/debug", double-check that the issue is present in the latest version of gowebdav and maybe narrow down the issue with some simple example + test config for local nginx/apache. I'll come back in a few days if I get any results. |
@admirallarimda did you took a deeper look? |
Unfortunately, not yet. I'll definitely try it out some day, but currently I cannot predict when I would have time for this. |
Line 16 in 425530b
TeeReader requires as much memory as the requested file size. This code needs to be improved to avoid out of memory when uploading large-size files. |
I also found the memory leak reported in this issue. Line 45 in 321978f
I've read the body of the response as it wasn't collected by GC. This would resolve the memory leak and also a not reported goroutine leak.
|
The main goal was to simplify the `req` method in `request.go` and making it easier to add more authentication methods. All the magic went into the `auth.go` file. This feature introduces an `Authorizer` which acts as an `Authenticator` factory. Under the hood it creates an authenticator shim per request, which delegates the authentication flow to our authenticators. The authentication flow itself is broken down into `Authorize' and `Verify' steps to encapsulate and control complex authentication challenges. Furthermore, the default `NewAutoAuth' authenticator can be overridden by a custom implementation for more control over flow and resources. The `NewBacisAuth` Authorizer gives us the feel of the old days.
The main goal was to simplify the `req` method in `request.go` and making it easier to add more authentication methods. All the magic went into the `auth.go` file. This feature introduces an `Authorizer` which acts as an `Authenticator` factory. Under the hood it creates an authenticator shim per request, which delegates the authentication flow to our authenticators. The authentication flow itself is broken down into `Authorize' and `Verify' steps to encapsulate and control complex authentication challenges. Furthermore, the default `NewAutoAuth' authenticator can be overridden by a custom implementation for more control over flow and resources. The `NewBacisAuth` Authorizer gives us the feel of the old days.
The main goal was to simplify the `req` method in `request.go` and making it easier to add more authentication methods. All the magic went into the `auth.go` file. This feature introduces an `Authorizer` which acts as an `Authenticator` factory. Under the hood it creates an authenticator shim per request, which delegates the authentication flow to our authenticators. The authentication flow itself is broken down into `Authorize' and `Verify' steps to encapsulate and control complex authentication challenges. Furthermore, the default `NewAutoAuth` authenticator can be overridden by a custom implementation for more control over flow and resources. The `NewBacisAuth` Authorizer gives us the feel of the old days.
The main goal was to simplify the `req` method in `request.go` and making it easier to add more authentication methods. All the magic went into the `auth.go` file. This feature introduces an `Authorizer` which acts as an `Authenticator` factory. Under the hood it creates an authenticator shim per request, which delegates the authentication flow to our authenticators. The authentication flow itself is broken down into `Authorize` and `Verify' steps to encapsulate and control complex authentication challenges. Furthermore, the default `NewAutoAuth` authenticator can be overridden by a custom implementation for more control over flow and resources. The `NewBacisAuth` Authorizer gives us the feel of the old days.
The main goal was to simplify the `req` method in `request.go` and making it easier to add more authentication methods. All the magic went into the `auth.go` file. This feature introduces an `Authorizer` which acts as an `Authenticator` factory. Under the hood it creates an authenticator shim per request, which delegates the authentication flow to our authenticators. The authentication flow itself is broken down into `Authorize` and `Verify' steps to encapsulate and control complex authentication challenges. Furthermore, the default `NewAutoAuth` authenticator can be overridden by a custom implementation for more control over flow and resources. The `NewBacisAuth` Authorizer gives us the feel of the old days.
The changes simplify the `req` method by moving the authentication-related code into the API. This makes it easy to add additional authentication methods. The API introduces an `Authorizer` that acts as an authenticator factory. The authentication flow itself is divided down into `Authorize` and `Verify` steps in order to encapsulate and control complex authentication challenges. The default `NewAutoAuth` negotiates the algorithms. Under the hood, it creates an authenticator shim per request, which delegates the authentication flow to our authenticators. The `NewEmptyAuth` and `NewPreemptiveAuth` authorizers allow you to have more control over algorithms and resources. The API also allows interception of the redirect mechanism by setting the `XInhibitRedirect` header. This closes: #15 #24 #38
The changes simplify the `req` method by moving the authentication-related code into the API. This makes it easy to add additional authentication methods. The API introduces an `Authorizer` that acts as an authenticator factory. The authentication flow itself is divided down into `Authorize` and `Verify` steps in order to encapsulate and control complex authentication challenges. The default `NewAutoAuth` negotiates the algorithms. Under the hood, it creates an authenticator shim per request, which delegates the authentication flow to our authenticators. The `NewEmptyAuth` and `NewPreemptiveAuth` authorizers allow you to have more control over algorithms and resources. The API also allows interception of the redirect mechanism by setting the `XInhibitRedirect` header. This closes: #15 #24 #38
Hello Collaborators,
Describe the bug
A short description of what you think the bug is.
Software
To Reproduce
I've started to build a small tool which would allow file syncing via WebDAV. It's not fully ready but at least it allows to scan a folder and create a list of files which should be uploaded. The flow of the program now is the following:
What I observe is enormous RAM usage by my tool (e.g. even if a folder contains files for 1G, it can easily take up to several gigabytes of RAM). I've tried to narrow the scope of the problem and here's what I've got:
I believe there's something wrong with current usage of TeeReader introduced in #b45378c. It looks like persistConn inside of a Transport somehow doesn't allow to collect the unused objects (i.e even if a new file gets uploaded, the data for the old one doesn't get cleared). Unfortunately I'm pretty new to Go and couldn't resolve the issue by myself.
Expected
Well, no memleak
Additional context
Just in case you're curious how do I use gowebdav exactly, here is the tool I'm using.
Please let me know if you need any additional info.
The text was updated successfully, but these errors were encountered: