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 TransferManger CRT Client OOM on large file upload #5032

Closed
thai-op opened this issue Mar 21, 2024 · 4 comments
Closed

S3 TransferManger CRT Client OOM on large file upload #5032

thai-op opened this issue Mar 21, 2024 · 4 comments
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@thai-op
Copy link

thai-op commented Mar 21, 2024

Describe the bug

We upload several big 12GB files to S3, and the JVM will OOM because of these:

S3TransferManager transferManager = S3TransferManager.builder().s3Client(S3AsyncClient
                .crtBuilder().targetThroughputInGbps(20.0).minimumPartSizeInBytes(8 * MB).build())
                .build();
// then upload
UploadDirectoryRequest uploadDirectoryRequest = UploadDirectoryRequest.builder()
                    .bucket(outputBucket).s3Prefix(outputFile)
                    .source(Paths.get(inputFile)).build();

DirectoryUpload upload = transferManager.uploadDirectory(uploadDirectoryRequest);
CompletedDirectoryUpload completedDirectoryUpload = upload.completionFuture().join();

### Expected Behavior

Not OOM on a 6gb container for uploading a 12GB file.

### Current Behavior

OOM

### Reproduction Steps

JVM 21 jre. Use 6gb container, JVM setting about the same, generate from large file then upload.

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### AWS Java SDK version used

2.25.15

### JDK version used

openjdk version "21" 2023-09-19 OpenJDK Runtime Environment (build 21+35-2513) OpenJDK 64-Bit Server VM (build 21+35-2513, mixed mode, sharing)

### Operating System and version

Amazon Linux amd64
@thai-op thai-op added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 21, 2024
@zoewangg
Copy link
Contributor

Can you share the stacktrace?

@thai-op
Copy link
Author

thai-op commented Mar 22, 2024

Yeah, I'll try. It's almost doesn't happen in my local computer, btw. I think this is because my local network is slow & so the s3 crt client is never fast enough to accumulate enough heap to run into OOM error. However, when I run in EC2 in a VPC where there's fast network with S3, the issue immediately happens.

So maybe that will help you pinpoint the issue a bit more while I'm trying to gather a stacktrace & heapdump in prod.

@thai-op
Copy link
Author

thai-op commented Mar 22, 2024

@zoewangg It doesn't seem to happen with sdk v2.25.15. False alarm. I think we are good here. Thanks!

@thai-op thai-op closed this as completed Mar 22, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

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. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants