Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / January 2008

Tip: Looking for answers? Try searching our database.

XmlTextReader and Memory

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
andrerus@gmail.com - 25 Jan 2008 11:52 GMT
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
Michael Nemtsev [MVP] - 28 Jan 2008 09:29 GMT
Hello andrerus@gmail.com,

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

> Hi. I've developed an application for Windows Mobile using 3.5 version
> of CompactFramework.
[quoted text clipped - 18 lines]
> different solution.
> Andrea
Kevin Spencer - 28 Jan 2008 11:20 GMT
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.

Signature

HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

> Hi. I've developed an application for Windows Mobile using 3.5 version
> of CompactFramework.
[quoted text clipped - 21 lines]
>
> Andrea

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.