New submission from Ofer Sadan <[email protected]>:
running `urllib.request.urlopen` multiple times causes the memory usage to
increase with each run, even after calling `close()` on the request or using
`del` on the result
To recreate this problem, run code:
import urllib.request
def ip():
r = urllib.request.urlopen('https://api.ipify.org')
b = r.read()
r.close()
print(len(b))
return b
for i in range(1000):
result = ip()
del result
Even though `len(b)` has a maximum value of 15 (for this url at least), the
memory increases with each run by 200KB - 1MB
----------
components: Library (Lib)
messages: 352968
nosy: Ofer Sadan
priority: normal
severity: normal
status: open
title: urllib.request memory leak / overflow
versions: Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue38251>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com