Author Ofer Sadan
Recipients Ofer Sadan
Date 2019-09-22.11:29:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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('')
        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
Date User Action Args
2019-09-22 11:29:48Ofer Sadansetrecipients: + Ofer Sadan
2019-09-22 11:29:48Ofer Sadansetmessageid: <>
2019-09-22 11:29:48Ofer Sadanlinkissue38251 messages
2019-09-22 11:29:48Ofer Sadancreate