I have a Mono for Android app that I think is running out of memory when I load and parse an XML document using the XMLDocument class multiple times in a row.
I see that the garbage collector is reporting that I only have 7367K of memory available, which seems quite low.
How can I increase this either through configuration or at runtime?
I found that there is a bug in the XmlDocument that causes it to crash in some situations (loading large XML files (~180K) quickly in sequence). I will be reporting this to Xamarin to see if they can investigate it further.
After I converted my code to use XmlTextReader instead, the memory behavior changed. Now the system dynamically increases the heap size reported during GC cycles. The size goes up and down as necessary and nothing crashes.
With the XmlDocument code, instead of increasing the heap size, it just crashed.