Kevin Spencer
1/28/2008 11:21:00 AM
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
<andrerus@gmail.com> wrote in message
news:92884780-9022-4275-976c-8f99b3f0e762@d70g2000hsb.googlegroups.com...
> 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