XmlTextReader and Memory

  • Thread starter Thread starter andrerus
  • Start date Start date
A

andrerus

Hi. I've developed an application for Windows Mobile using 3.5 version
of CompactFramework.
My application generally uses (into the heap) approximately 7kB. Then
I decided to introduce a XML configuration feature, but now it needs
nearly 80kB!!!
Looking at the heap, I found a 64kB sized array allocated by the
constructor of XmlTextReader (used inside XmlDocument). The problem is
that, even if I close XmlTextReader or set to null my ConfiguratorObj,
and then do a GC.Collect(), that array isn't deallocated.

Looking at rotor sources, I found that the array is
private static byte* s_CharProperties;
of XmlCharType, that is setted to
new byte[CharPropertiesSize]
where
private const uint CharPropertiesSize = (uint)char.MaxValue + 1;

I can't understand what this array is and what it contains, so I can't
understand if this allocation is useful and normal, but I'd like to
continue using XML to configure my application without spend so much
memory.
Does anybody help me explaining what happens or also suggesting
different solution.

Andrea
 
Hello (e-mail address removed),

I would refer this question to "compactframework" NG

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
 
When you use XML Configuration, the configuration file is a serialized
instance of a class which is read and kept in memory during the life of the
process.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
 
Back
Top