I'm having problems looping over an XML file about 20-30 MB (650000 rows).
This is my meta-code:
<cffile action="READ" ile="file.xml" variable="usersRaw">
<cfset usersXML = XmlParse(usersRaw)>
<cfset advsXML = XmlSearch(usersXML, "/advs/advuser")>
<cfset users = XmlSearch(usersXML, "/advs/advuser/user")>
<cfset numUsers = ArrayLen(users)>
<cfloop index="i" from="1" to="#numUsers#">
... some selects...
... insert...
<cfset advs = annunciXml[i]["vehicle"]>
<cfset numAdvs = ArrayLen(advs)>
<cfloop index="k" from="1" to="#numAdvs#">
... insert... or ... update...
</cfloop>
</cfloop>
struct of xml file is (yes, is not very good :-)
<advs>
<advuser>
<user>
</user>
<vehicle>
<vehicle>
</advuser>
</advs>
After ~120,000 rows I get an error: "Out of memory".
How can I improve performance of my script?
How can I diagnose where there is max memory consumption?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…