I have quite a large xml file and relatively little memory. Whilst parsing the file, i am currently loading the entire file into memory as seen in the code snippet below which slows the whole computer down and sometimes doesnt even work. I was wondering if there is a way to only load one item into memory at a time? Perhaps using some multiprocessing like in deep learning when the next file is loaded whilst the current one is being processed.
root = ET.parse("my_file.xml").getroot()
for child in root:
do_something()