473,467 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Memory 'leak'?! how to track down?

Application setup is a 'standard' fat client communicating using .NET
Remoting (custom channel) to a Windows service. Most of the application is
C# but on the server there is a little bit of managed C++ to wrap up a C DLL
from a 3rd party.

Basic steps (very summarised!) to highlight my problem:
Client makes a connection to the service
Client calls method on connection object to reconstruct existing object from
a file
Server side BL uses the XML string (read from file) and the .NET XML
Serialiser to create an
object of the required type
Client is then given a reference to this object.

The serialised XML file size is around 2MB (but can be large - MUCH
larger!!!). I notice that the VM size tracked in Task Manager grows a hell
of a lot more than 2MB so I rooted around and bought a memory analyser tool
(Scitech Software). It's very good at showing me the .NET allocations - I
can see that I've created a number of classes and the size and numbers look
OK to me. However, they list <Other> as an item and the memory listed
against it is huge! I did a quick debug step through the code and saw some
possible issues - the XML serialiser objects seemed to take huge amounts of
memory and none of it is ever released?! It would seem to me that I'm either
doing something wrong, .NET (I'm on V1.0) is doing something wrong and/or
I've orphaned some objects and not dereferenced them properly (although the
tool I've got is not highlighting this last point as an issue!). Could I be
correct in thinking that the serialisation usage could be an issue

Just a little more info - one of my class serialisation files is 27.5MB and
by the time I've loaded it and shown some data on the screen the service
process has 1GB VM allocated!! I've tried forcing GC to run and it does
release a little but not much in comparison to what's being used!

Here's my simple deserialisatoin code in server side BL for the object in
question:

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.InnerXml = inXML;

XmlSerializer serializer = new XmlSerializer( typeof( CMyObject ) );
XmlParserContext context = new XmlParserContext( null, null, null,
XmlSpace.None );
XmlReader xmlReader = new XmlTextReader( xmlDoc.OuterXml,
System.Xml.XmlNodeType.Document, context );
CMyObject myObject = (CMyObject) serializer.Deserialize( xmlReader );
xmlReader.Close();

I know it's a shot in the dark but can anyone give me some pointers on where
to start looking - I finding it a little overwhelming at the moment!

Many thanks in advance!


Jul 21 '05 #1
1 1539
If you found scitech, your on the right track. Read their PDF file very
closely. I also found this site to be a good reference:

http://www.automatedqa.com/techpaper...n_profiler.asp

Also don't hesitate to call Support on this. They have acknowledged leaks in
1.0 (and 1.1) that a hot fix is available for. As they say usual support
charges may not apply:

http://support.microsoft.com/support....asp?id=817723

HTH;
Eric Cadwell
http://www.origincontrols.com
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: mark.engelberg | last post by:
I am having trouble identifying the source of a memory leak in a Windows Python program. The basic gist is as follows: 1. Generate a directed graph (approx. 1000 nodes). 2. Write the graph to a...
8
by: ranjeet.gupta | last post by:
Dear All Is the Root Cause of the Memory corruption is the Memory leak, ?? suppose If in the code there is Memory leak, Do this may lead to the Memory Corruption while executing the program ? ...
6
by: Mike | last post by:
..NET 1.1 Hi. My C# .NET application has a memory leak - if I leave it running for hours then the system ends up using 500MB+ of virtual memory, which is released immediately when I close the...
20
by: jeevankodali | last post by:
Hi I have an .Net application which processes thousands of Xml nodes each day and for each node I am using around 30-40 Regex matches to see if they satisfy some conditions are not. These Regex...
7
by: Rich Denis | last post by:
Hello, I have been trying to solve a mysterious memory leak problem and was hoping that you could help me out on my stuck point. First a bit of background. We have two app servers in an app...
7
by: Gary Townsend | last post by:
I have written a program in vb .net and want to go about trying to track down a memory leak when i run my program and monitor it using the task manager in windows 2k my program has a stead...
8
by: Adrian | last post by:
Hi I have a JS program that runs localy (under IE6 only) on a PC but it has a memory leak (probably the known MS one!) What applications are there that I could use to look at the memory usage of...
1
by: =?Utf-8?B?V2luRGV2?= | last post by:
I have a machine that I've moved some web services to and now w3wp.exe just keeps taking more and more memory (I don't think it did it on the old machine.) So apparently I have a memory leak...
9
by: jeungster | last post by:
Hello, I'm trying to track down a memory issue with a C++ application that I'm working on: In a nutshell, the resident memory usage of my program continues to grow as the program runs. It...
3
xarzu
by: xarzu | last post by:
Apart from buying BoundsChecker or any of the other tools to track down memory leaks. Does anyone have any advice or tips from your years of programming experience to offer on how to track down the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.