I'm parsing a large number (>1000) of XML files by enumerating a directory, then inserting the parsed data into Yap Database. I tried SWXMLHash
and AEXML
. Both of them demonstrated similar memory usage, as below:
The plunge comes when the enumeration/insertion finishes. If I read the XML as plain string, it works fine with memory consumption below 160 MB. Using Instruments I'm sure there is no memory leaks and there can't be, as memory is reclaimed at last. So what's going on here?
===== Update:
Eliminating all other possibilities, I came to find out that it ain't because of XML parsing or Yap Database. It's because of the array creation in the XML parsing function.