I got the following problem. I am working with small machine with low memory (1 GB). my program download a huge gzip file from some url. And I need to decompress it to dict I know for sure that the file is in json format. My problem is that after I run the following command I got a memory error:
data = zlib.decompress(url, 16 + zlib.MAX_WBITS).decode('utf8')
results_list.append(json.loads(data ))
now for small files this works fine, but for large I got the error. my intuition tells me that I should split the file into chunks, but then because I am expecting a json file i wont be able to restore the chunks back to json (because each part wont be a valid json string).
what I should do?
Thank a lot!