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

Memory usage #14

Closed
ghost opened this issue Sep 3, 2021 · 6 comments · Fixed by #15
Closed

Memory usage #14

ghost opened this issue Sep 3, 2021 · 6 comments · Fixed by #15

Comments

@ghost
Copy link

ghost commented Sep 3, 2021

why does it take 14GB+ usage of ram to upload a 5GB file?

@jkawamoto
Copy link
Owner

The library this app uses needs to copy the uploading file into RAM at least two times to build a request. That means it'll consume at least 10GB RAM to upload a 5GB file.

Btw, can you upload a 5GB file? The API document looks like the max file size is 1GB:

スクリーンショット 2021-09-03 3 47 01

@ghost
Copy link
Author

ghost commented Sep 3, 2021

yes, you can upload 5GB via API. 15GB if you have pro account, etc.

i emailed pixeldrain support and Wim gave me a go app for uploading: https://pixeldrain.com/u/V8UGqPb4
pd "file/location/here"

does not consume ram which is an issue with your app i have as I upload large file simultaneously and i run out of ram.

Wim's app does not copy files into ram it seems, no usage at all. bottleneck is going to be your upload speed to PD not disks so i don't see need to copy to ram. maybe you can rework that. =)

btw if you email PD suport wim will provide source code for the go app i linked above if you are interested.

@jkawamoto
Copy link
Owner

I see. I've just opened a PR go-openapi/runtime#214. It'll reduce the RAM usage.

@ghost
Copy link
Author

ghost commented Sep 5, 2021

I see, thank you :)

@Fornax96
Copy link

Here's the source code for my uploader: https://pixeldrain.com/u/VmcG7r4f

It spawns a separate goroutine to create the multipart file in the background.

@jkawamoto
Copy link
Owner

Thanks for the source code. It looks like go-openapi/runtime, which is used in this app, also uses a goroutine to prepare the multipart message:

https://github.com/go-openapi/runtime/blob/2bc043c8ba8a760fd663163517bac1fb69fd717a/client/request.go#L131-L186

It wan't optimal to compute a content type but it's fixed now.

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

Successfully merging a pull request may close this issue.

2 participants