I am new to working with comparably large xml-files and now I come across the following problem:
I am using the the lxml package to parse a 348.9 MB xml-file and monitored the RAM usage using the activity monitor on my Mac (macOS 10.13.5). Surprisingly, 6 GB of RAM are occupied after executing the code example below.
from lxml import etree
tree=etree.parse(path_to_file)
root=tree.getroot()
Can anyone explain to me why this happens and suggest an alternative method?