XmlTextReader and Memory

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
 
M

Michael Nemtsev [MVP]

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
 
K

Kevin Spencer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top