C# : the close method of Xml.Load(file)

ejwswtmbbv

New Member
i have created a piece of code that loads the XMLDocument to read/count it`s nodes , here is the method :\[code\] XmlDocument xml = new XmlDocument(); xml.Load(textBox1.Text); XmlNodeList nodes = xml.SelectNodes("//File"); foreach (XmlNode node in nodes) { number_of_childs++; }\[/code\]The problem i am facing is : when importing large file , that takes like 700MB of RAM and if i tried to do some operation on file or even reading from it to display its data on a listview , the application takes like 2GB of RAM , so i was wondering if there is a method that closes the XMLDocument and free its memory space of RAM.It is like forgetting it`s content to free RAM.
 
Back
Top