Note that there are some explanatory texts on larger screens.

plurals
  1. POTrack OutOfMemory exception?
    text
    copied!<p>I have an application that is written in VB.NET 2010, it is designed to load XML data as a string, and do some pretty complex parsing to repair the XML structure and log elements that cannot be logically repaired, before loading into an XMLDocument object.</p> <p>The problem I when the files grow large 60+ MB range, it throws an OutOfMemory exception on attempting the read of the file.</p> <p>I have a string declared, and I am reading the whole file into the string by use of IO.StreamReader.ReadToEnd()</p> <p>if I read the same file in a blank app by the same method it reads no problem.</p> <p>The machine it is running on is W764 8GB ram, 5 idle at the time I load the file. Memory usage on the app is 10mb prior to the ReadToEnd(), and debugger is breaking on the ReadToEnd(), not any potentially developer caused processing bloat.</p> <p>No way am I maxing the memory, blank app reading the file into the string levels at around 350mb when file is finished reading in.</p> <p>So what I do not get is how the call fails between the blank app, and the production app, perhaps some other objects have memory reserved that does not show in the task manager? But really, 5gb idle to load a &lt; 100mb of data.</p> <p>I also have no clue how to track it any further because it happens in the method of the CLR, not developer code, any suggestions greatly appreciated.</p> <pre><code> Dim Data As String Using reader As New StreamReader(fileName) Data = reader.ReadToEnd() &lt;- Breaks here End Using </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload