Python returns "dead" when trying to read json 240mb [closed]

1

The problem occurs on a final CentOS server version 6.8. The same script with another smaller file works perfectly.

Test done in Ubuntu 16.04 the process occurs successfully.

Any solution? Follow the code below.

gist code

    
asked by anonymous 20.04.2017 / 15:16

1 answer

1

Because your JSON is a bit large, when you try to read it in memory, your PC may crash out of memory.

So, try changing the line where you read JSON :

jsonToPython = json.load(data_file)

To use a library such as ijson or a json-streamer , which are specific for manipulating files with large volumes of data.

    
27.04.2017 / 16:24