Skip to content

potential memory leak in aws sdk s3 code #3924

Closed
@gorell

Description

@gorell

Describe the bug

Hi Team. We run our code (that reads-from/writes-to s3) over time. We use v2.20.42. When taking heap dumps we observe consistent memory growth, like this:

-rw-r--r--  1 user  staff  394378864 Apr 18 13:54 /Users/user/heap1.bin
-rw-r--r--  1 user  staff  402753779 Apr 18 14:05 /Users/user/heap2.bin
-rw-r--r--  1 user  staff  409832891 Apr 18 14:11 /Users/user/heap3.bin
-rw-r--r--  1 user  staff  415905366 Apr 18 14:23 /Users/user/heap4.bin

When comparing heap dumps we can see that the majority of the new objects on the heap seem to be related to AWS SDK S3 library, almost solely reflecting the above memory growth. Screenshots attached. Code attached. Please your advice on the above. Thanks in advance.
aws-dal.zip
Screenshot 2023-04-20 at 15 55 39
Screenshot 2023-04-20 at 15 55 56

Expected Behavior

The memory dumps should remain consistent over time, no leaks should occur.

Current Behavior

The memory grows on a regular basis due to AWS SDK S3 library objects being created on the heap and not released.

Reproduction Steps

Run the attached code over time.

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

2.20.42

JDK version used

openjdk 11.0.14.1

Operating System and version

Linux service-5b7c8c4788-c62fp 5.4.238-148.347.amzn2.x86_64 #1 SMP Thu Apr 6 19:42:57 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions