strings, xml deserialize?

Use this forum to read, ask or inform about memory issues in the .NET Framework and third party components.

Moderator: SciTech Software

strings, xml deserialize?

Postby feto » Fri Sep 02, 2005 4:58 pm

How can we avoid the memory allocated by the strings? Out application uses a lot of logging, hence a lot of stings and I have a feeling they are causing the issue.

Also, any idea if the xml deserializing causes memory leaks?
feto
 
Posts: 1
Joined: Fri Sep 02, 2005 4:56 pm

Postby Andreas Suurkuusk » Mon Sep 05, 2005 8:31 pm

What kind of problem are you experiencing with the allocated strings?
Are you seeing excessive memory usage by String instances, or are there simply a lot of strings allocated? Logging could cause a lot of allocated string instances, but it should not lead to excessive memory usage, unless there is a memory leak or if you're logging to memory.

AFAIK, there are no leaks when deserialing XML. Are you having memory problems when working with XML?
Best regards,

Andreas Suurkuusk
SciTech Software AB
Andreas Suurkuusk
 
Posts: 963
Joined: Wed Mar 02, 2005 7:53 pm
Location: Sweden

I've got same problem

Postby CarlVerret » Mon Apr 03, 2006 3:17 pm

Hi,

After watching the 3rd tutorial on this site, I began beeing concerned about memory leaks, especially memory used by strings. I've got an enormous amout of memory that never seems to be freed (about half of all string instances never deallocate).

Is there any way to investigate string usage ? I wonder how could I resolve total memory alloc peaks.

Any ideas would be greatly appreciated. Thanks
CarlVerret
 
Posts: 1
Joined: Mon Apr 03, 2006 3:10 pm

Postby Andreas Suurkuusk » Wed Apr 05, 2006 6:53 pm

I'm not sure what your problem is. You mention that you have string instances that are never freed. Do you see these instances as "Live instances" (i.e. reachable instances), or only as additional "Total instances" (i.e. instances that are not reachable but have not yet been GCed)?

To avoid unnessary memory overhead, you should try to avoid promoting instances to higher generations. This is often not very easy, but you should try to keep the life-time of instances as short as possible (as shown in Tutorial 3). Have you tried to enable the heap utilization tracker? It will help you locate methods that allocate instances that get promoted to higher generations.

You enable the heap utilization tracker using the Tools->Settings dialog. To view how the heap is utilized, you should select the "Heap utilization" classes view.

For optimal behavior, all instances should be GCed in generation #0. When the heap utilization tracker is enabled, you will also be able to collect a heap snapshot using only a gen #0 GC. After this snapshot you will be able to see how many instances that still reside on the GC heap even though they're not reachable from any root. You will also be able to identify the methods (and call stacks) that create these instances.
Best regards,

Andreas Suurkuusk
SciTech Software AB
Andreas Suurkuusk
 
Posts: 963
Joined: Wed Mar 02, 2005 7:53 pm
Location: Sweden


Re: strings, xml deserialize?

Postby n/a » Wed May 02, 2012 10:18 am

There's also a blog : http://blogs.msdn.com/b/tess/archive/20 ... 32804.aspx
And a Support entry about XmlSerialization : http://support.microsoft.com/kb/886385/en-us
n/a
 


Return to Known Memory Issues

Who is online

Users browsing this forum: No registered users and 1 guest

SciTech Software logo

© Copyright 2001-2016. SciTech Software AB
All rights reserved.


SciTech Software AB
Kartvägen 21
SE-175 46 Järfälla
Sweden


E-mail: mail@scitech.se

Telephone: +46-706868081

cron