Hi, I see a memory leak in the following code. The memory usage of the Python process grows without bound. (Python 2.7)
(The "psutil" module stuff is just diagnostics, it can be removed)
import sys,os
#import json
import yajl as json
import psutil
myproc = psutil.Process(os.getpid())
data = json.loads(sys.stdin.read())
for i in xrange(1000000):
d2 = json.dumps(data)
if i % int(1e4) == 0:
print>>sys.stderr, myproc.get_memory_info()
It is data dependent. Here's a 7KB data file that causes it.
Hi, I see a memory leak in the following code. The memory usage of the Python process grows without bound. (Python 2.7) (The "psutil" module stuff is just diagnostics, it can be removed)
It is data dependent. Here's a 7KB data file that causes it.
However, certain other data files don't cause it. For example, if I do
I don't see any leak. Maybe it has something to do with having lots of different strings?