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

S3 client creation leaks memory #823

Closed
steven-aerts opened this issue Aug 20, 2024 · 2 comments · Fixed by #824
Closed

S3 client creation leaks memory #823

steven-aerts opened this issue Aug 20, 2024 · 2 comments · Fixed by #824
Labels
bug This issue is a bug. p2 This is a standard priority issue pending-release This issue will be fixed by an approved PR that hasn't been released yet.

Comments

@steven-aerts
Copy link

Describe the bug

Every time a crt S3 client is created it will leak memory, as it is not cleaning up its TLS Contexts correctly.

This issue was detected in our production environment and is also tracked under AWS Support ticket172363023300722.

Expected Behavior

Memory leaks

Current Behavior

No Memory Leaks

Reproduction Steps

Execution the following code will exhaust the memory of the machine it runs on:

for(;;) {
    try(
            var tlsc = new TlsContext();
            var c = new S3Client(new S3ClientOptions()
                    .withRegion("eu-west-1")
                    .withClientBootstrap(ClientBootstrap.getOrCreateStaticDefault())
                    .withTlsContext(tlsc)
    )) {
        
    }
}

This snippet was derived from production usage of the higher level S3AsyncClient.createCrt() function.

Possible Solution

No response

Additional Information/Context

No response

aws-crt-java version used

0.30.3

Java version used

21

Operating System and version

Linux

@steven-aerts steven-aerts added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 20, 2024
@jmklix
Copy link
Member

jmklix commented Aug 20, 2024

Thanks for making the PR, we're testing it before merging it.

@jmklix jmklix linked a pull request Aug 20, 2024 that will close this issue
@jmklix jmklix added pending-release This issue will be fixed by an approved PR that hasn't been released yet. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Aug 20, 2024
@jmklix
Copy link
Member

jmklix commented Aug 23, 2024

The PR with the fix is here, along with test for memory leaks. Please wait for the Java sdk to update with the latest version of aws-crt-java.

@jmklix jmklix linked a pull request Aug 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue pending-release This issue will be fixed by an approved PR that hasn't been released yet.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants