Closed mmichealjroberts closed 4 years ago
Hi @michealjroberts,
https://github.com/googleapis/google-api-python-client/issues/535 reports the same issue.
The out of memory seems to come from repeated calls to discovery.build(...)
. That also has a small benefit for credentials, which will be re-used until they expire.
Copied from https://github.com/googleapis/google-api-python-client/issues/535
service = discovery.build("sheets", "v4")
sheets = service.spreadsheets()
for i in range(0, 50):
get_responses(sheets)
sleep(2) # no leak
Environment details
python --version
Python 3.8.1pip --version
pip 20.2.3 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)google-api-python-client
version:pip show google-api-python-client
1.12.3There seem to be memory leaks again with this client. Very frustrating. Here are some stack trace examples:
Stack trace
This is absolutely unacceptable and possibly the first time I have seen this number of Memory errors of this nature from a python package.