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

Warning before reading a large file into memory #3

Open
amoodie opened this issue May 5, 2020 · 0 comments
Open

Warning before reading a large file into memory #3

amoodie opened this issue May 5, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@amoodie
Copy link
Contributor

amoodie commented May 5, 2020

Eric raises a good point, that

someone might [be] exploring the API, and just try to read all variables from a 50 GB dataset into memory, without realizing it.

A solution may be to query the file with a psutil call before any read, and if the file is >80% of the total available memory:

  • issue a warning, and NOT load the file into memory.
  • in the warning describe that adding a force=True to the read call will override our warning and proceed.

This seems like a reasonable compromise between "swim at your own risk" and recklessness.

Originally suggested by @ericbarefoot in #2

@amoodie amoodie added enhancement New feature or request good first issue Good for newcomers labels Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant