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

Unmanaged memory leak in v5+ #264

Closed
eddietibber opened this issue Nov 28, 2024 · 4 comments
Closed

Unmanaged memory leak in v5+ #264

eddietibber opened this issue Nov 28, 2024 · 4 comments

Comments

@eddietibber
Copy link

eddietibber commented Nov 28, 2024

Describe the bug
Version 5.0.0 and 5.0.1 of the unleash dotnet client leaks unmanaged memory when calling IUnleash.IsEnabled. Cannot reproduce on v4.1.15

To Reproduce
This code will reproduce it, referencing Unleash.Client v 5.0.0:

using Unleash;
using Unleash.ClientFactory;

var unleash = new UnleashClientFactory().CreateClient(new UnleashSettings()
{
    UnleashApi = new Uri("..."),
    CustomHttpHeaders = new Dictionary<string, string> { ["Authorization"] = "..." },
}, true);

for (int i = 0; i < 100_000_000; i++)
{
    unleash.IsEnabled("my-feature");
}

Expected behavior
Very low unmanaged memory consumption

Screenshots
Over 600MB unmanaged memory allocated after just 15s
swappy-20241128_134723

Desktop:

  • OS: Manjaro linux

Server:

  • OS: Docker, using aspnet9.0-alpine image (tested with aspnet9.0 and aspnet9.0-chisel too, same result)

Additional context:
This is the memory profile using v 4.1.15
swappy-20241128_135401

@daveleek
Copy link
Collaborator

Interesting, thank you @eddietibber! We'll take a look and report back!

@sighphyre
Copy link
Member

@eddietibber Oh. Found the leak. Patch is on the way out. Sorry about that, thanks for the bug report

@eddietibber
Copy link
Author

Swift response, thank you!

@sighphyre
Copy link
Member

Okay, 5.0.2 is out, which I believe closes this. Memory seems to be stable now running that same test. Thank you so much for reporting this @eddietibber!

@github-project-automation github-project-automation bot moved this from New to Done in Issues and PRs Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants