Im using mac mini with ios 10.9.2 and Python 3.3. I wrote simple Python app, which fetch api data and shows some calculation. Everything is working well, but i saw in Activity Monitor (os tool) that after few connections system memory usage incrases, but in my opinion it shouldnt. I wouldnt publish aplication that can eat all memory so I need a help.
Here is a pice of my code which makes this problem:
I tried to do in another way but it makes memory usage incrasing too:
This makes memory usage higher too:
Thank you in advance!
Here is a pice of my code which makes this problem:
Code:
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)
Code:
req = request.urlopen('https://btc-e.com/api/2/btc_usd/trades')
urlData = json.loads(req.read().decode('utf-8'))
Code:
from urllib.request import urlopen
html = urlopen("https://btc-e.com/api/2/btc_usd/trades")
Comment