-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Get "java.lang.OutOfMemoryError" when using TransferManager.uploadDirectory to upload a 81G directory #1271
Comments
As a workaround, your suggestion of iterating the files yourself (using Is this a one-off upload or something you'll be building into a service? |
Thanks @millems. I got the idea and I think DirectoryStream may help me. I am working on a project that back up such large directory with a large number files to S3 by the way. |
I gotcha. If it's ever just a one-off thing, they AWS CLI might handle it better for now (it has a mechanism for synchronizing a directory to S3). I've added a note that we should fix this in our 2.x version, which won't be limited to Java 6. Let me know if you have any trouble getting it to work the "hard" way. We could consider adding an overload that takes in an Iterable instead of the current List. That will allow us to load them from a DirectoryStream that you provide. |
Going to go ahead a close this due to inactivity. Please feel free to reopen if you @millems's suggestion didn't work for you and you want to open this as a feature request. |
Hi guys, I need to reopen this issue. I followed your suggestions and used DataStream to iterate file system myself and then used TransferManager.upload(file, bucket, key) to upload each file. And I always got this error (java aws sdk): AmazonS3Exception: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.... And then every thread just died gradullay. I saw other issues related to this problem like here Any suggestions on how to solve this when using java sdk? I cannot find any option to retry uploading in API TransferManager.upload(file, bucket, key) or PutObjectRequest. Thanks a lot. |
Hi, below is my issue:
Issue:
I used TransferManager.uploadDirectory in aws-sdk-java to transfer a big directory (81G) to S3 bucket, and get "java.lang.OutOfMemoryError". I counted and there are 3015,427 files in that directory. By tracing the stack I can see this seems due to TransferManager.listFiles() which recursively lists all files and uploads them.
Trace Stack:
Question:
Thank you so much!
The text was updated successfully, but these errors were encountered: