Memory Python 3.3 urllib内存泄漏

Memory Python 3.3 urllib内存泄漏,memory,urllib,python-3.3,Memory,Urllib,Python 3.3,我正在将MacMini与iOS 10.9.2和Python 3.3一起使用。 我编写了一个简单的Python应用程序,它获取api数据并显示一些计算结果。 一切正常,但我在Activity Monitor(操作系统工具)中看到,经过几次连接后,系统内存使用量会增加,但我认为不应该增加。我不会发布会消耗所有内存的应用程序,所以我需要一些帮助 下面是我的一段代码,它导致了这个问题: import urllib.request import time class Main(object):

我正在将MacMini与iOS 10.9.2和Python 3.3一起使用。
我编写了一个简单的Python应用程序,它获取api数据并显示一些计算结果。
一切正常,但我在Activity Monitor(操作系统工具)中看到,经过几次连接后,系统内存使用量会增加,但我认为不应该增加。我不会发布会消耗所有内存的应用程序,所以我需要一些帮助

下面是我的一段代码,它导致了这个问题:

import urllib.request
import time

class Main(object):
    def Get(self, url):
        urlData = urllib.request.urlopen(url)
        for line in urlData:
            line = str(line,'utf-8')
            print( line.rstrip() )
        urlData.close()
        time.sleep(1)

M = Main()
url = "https://btc-e.com/api/2/btc_usd/trades"
b=1

while b>0:
    M.Get(url)
    b=b+1
我尝试过用另一种方法,但它也增加了内存使用:

req = request.urlopen('https://btc-e.com/api/2/btc_usd/trades')
urlData = json.loads(req.read().decode('utf-8')) 
from urllib.request import urlopen
html = urlopen("https://btc-e.com/api/2/btc_usd/trades")
这也会增加内存使用率:

req = request.urlopen('https://btc-e.com/api/2/btc_usd/trades')
urlData = json.loads(req.read().decode('utf-8')) 
from urllib.request import urlopen
html = urlopen("https://btc-e.com/api/2/btc_usd/trades")
提前谢谢你