google-api-python-client
google-api-python-client copied to clipboard
Memory leak - issue while downloading large files
Issue : next_chunk method stores downloaded content to 'fd' file object. This downloaded content is stored in ram. As the file size increases, it consumes more RAM to store downloaded data.
Reference - https://github.com/googleapis/google-api-python-client/blob/5399bd3bf34ef31302a77ff484ef0067a18709a6/googleapiclient/http.py#L755
Related issues: #512 #198
Hi @parthea,
Please check the pull request. I have added "MediaGenBaseDownload" class which will yield fetched chunks in order to keep RAM consumption linear(equal to chunksize), with the backward compatibility.
One of my commit did not had verified tag, and also causing it to fail CLA check. I will have to create new PR.