Skip to content

Large file cause MemoryError #16

@JokerQyou

Description

@JokerQyou

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions