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

Upload very big files #17

Open
gquintana opened this issue Mar 31, 2022 · 0 comments
Open

Upload very big files #17

gquintana opened this issue Mar 31, 2022 · 0 comments
Assignees

Comments

@gquintana
Copy link
Contributor

At the moment, when uploading a file, the file content is generated in the heap memory prior to the Put Object request:
https://github.com/jenshadlich/S3-Performance-Test/blob/master/src/main/java/de/jeha/s3pt/operations/Upload.java#L39

This limits the file size to the maximum heap size (-Xmx) divided by the number of threads. With -Xmx1G and 4 threads, I can not send files bigger than 256M without generating an OOME.

2 solutions are possible, and both seem interesting to me:

  1. Generate file content as it is uploaded. It should be possible to implement an InputStream which randomly generates bytes as they are requested.
  2. Generate file content as a local temporary file. Even if the time taken to write the local file is a pure loss, it would allow S3 client to use a "send file" system call which is more efficient (no Java heap required).
@jenshadlich jenshadlich self-assigned this Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants