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

Large file cause MemoryError #16

Open
JokerQyou opened this issue Sep 26, 2014 · 1 comment
Open

Large file cause MemoryError #16

JokerQyou opened this issue Sep 26, 2014 · 1 comment

Comments

@JokerQyou
Copy link

Hi there, it's me again.
Since the last time I asked about download large file streamly via OAuth2 , I eventually found there's possibly a bug in your code. I noticed an unnormal RAM usage which would even use up all RAM on old computers. This happens during the last few seconds of downloading a file (50+ MB).

And I found this is somethins related to this line:

self.body = response.text

If changed to:

        options = {'parse': 'text'}
        options.update(opts)
        if options['parse'] in ('text', 'query', 'json', ):
            self.body = response.text

would solve this problem, and also lower the RAM usage during small size file downloading.

@smileboywtu
Copy link

        options = {'parse': 'text'}
        options.update(opts)
        self.options = options
        if options['parse'] in ('text', 'query', 'json', ):
            self.body = response.text

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