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

Determine memory requirements for download #1

Open
johnbradley opened this issue Sep 15, 2022 · 2 comments
Open

Determine memory requirements for download #1

johnbradley opened this issue Sep 15, 2022 · 2 comments

Comments

@johnbradley
Copy link
Collaborator

The current download logic may be importing the entire file into memory here:

dataverse-access/dv.py

Lines 73 to 74 in 7a67502

response = data_api.get_datafile(file_id)
f.write(response.content)

Determine if there is a streaming approach to reduce requirements.

@johnbradley
Copy link
Collaborator Author

The data_api.get_datafile(file_id) call will download the entire file and keep it in memory. There is an issue requesting the ability to add the streaming flag to avoid this un-necessary memory allocation: gdcc/pyDataverse#49

johnbradley added a commit that referenced this issue Sep 27, 2022
Replaces pyDataverse DataAccessApi.get_datafile call with
equivalent code that streams the response instead of fetching
the entire file into memory.
The StreamingDataAccessApi object can be removed once this
pyDataverse issue is resolved: gdcc/pyDataverse#49

Fixes #1
@johnbradley
Copy link
Collaborator Author

I am looking into using libcurl to handle streaming uploading and downloading via pycurl.
I had trouble installing pycurl with pip in multiple environments. It would install fine, but fail at runtime.
So using pycurl would likely require conda.

johnbradley added a commit that referenced this issue May 11, 2023
Uses `curl` command line tool to stream files when uploading
and downloading since pyDataverse keeps the entire file
in memory when uploading and downloading.

Fixes #1

Upgrades github checkout to v3 to fix nodejs warning for v2.
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

1 participant