Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Tue, 29 Jul 2008 02:55:03 -0700,    group: microsoft.public.xml        back       


MSXML and memory leak   
hi ,


I am building a VC++  application, in which i am using MSXML 6 parser.  The 
problem i am facing the memory consumption by the application. I had profiled 
the application using AQTime and the profiler shows the increase the memory 
consumption by the MSXML6.dll. Once the xml related task is over the memory 
occupied by the application should get release but that does not happen and 
the major part of memory is occupied by the MSXML6.dll .

The basic outline of the application:

1. Starts the application ( average memory consumption at this stage is ~20MB)
2. Starts a new thread ( for handling the XML function)
3. Initializes the IXMLDOMDocument.
4. Performs the xml related operations ( loading, reading- writing , saving 
the xml file )
( When the application is in stage 4 ( mentioned above ) the memory 
consumtion continuously increases.)
5. Once the required xml task is over , releases the xmldomdocument 
objectthe thread exits but still the memory consumtion is same.
6. The memory is released only after the application is closed.


I searched a lot on the net about this problem but couldnt get the correct 
solution.

Can anyone suggest what to do?


Thanks in advance.

-regards,
Tanish S.
date: Tue, 29 Jul 2008 02:55:03 -0700   author:   Tanish

Re: MSXML and memory leak   
"Tanish"  wrote in message
news:C0062A7E-AF43-4218-81A7-51E8F3D40528@microsoft.com...
> hi ,
>
>
> I am building a VC++  application, in which i am using MSXML 6 parser.
The
> problem i am facing the memory consumption by the application. I had
profiled
> the application using AQTime and the profiler shows the increase the
memory
> consumption by the MSXML6.dll. Once the xml related task is over the
memory
> occupied by the application should get release but that does not happen
and
> the major part of memory is occupied by the MSXML6.dll .
>
> The basic outline of the application:
>
> 1. Starts the application ( average memory consumption at this stage is
~20MB)
> 2. Starts a new thread ( for handling the XML function)
> 3. Initializes the IXMLDOMDocument.
> 4. Performs the xml related operations ( loading, reading- writing ,
saving
> the xml file )
> ( When the application is in stage 4 ( mentioned above ) the memory
> consumtion continuously increases.)
> 5. Once the required xml task is over , releases the xmldomdocument
> objectthe thread exits but still the memory consumtion is same.
> 6. The memory is released only after the application is closed.
>
>
> I searched a lot on the net about this problem but couldnt get the correct
> solution.
>
> Can anyone suggest what to do?
>

Having got passed step 1 have you tried having your app repeat steps 2 to 5
several times before closing the app.  Does it "leak memory" by the same
significant amount on each pass or after the first or second pass does the
allocated amount of memory stabilise?

MSXML manages its own heap of memory for collecting nodes, this memory is
shared by all documents.  It has a form of GC to manage this heap.  It also
permentantly maintains a name table so if you have wide variety of
namespaces and element names that can get quite big.


-- 
Anthony Jones - MVP ASP/ASP.NET
date: Tue, 29 Jul 2008 14:44:44 +0100   author:   Anthony Jones

Re: MSXML and memory leak   
Hi,

thanks for the response. 

Yes, the memory leak in consitent in each pass ( from step 2 to step 5).  I 
had read an article on the GC of MSXML , but it didnt help much. 

Can you suggest anything else so that the memory leak problem solved. 


-tanish

"Anthony Jones" wrote:

> "Tanish"  wrote in message
> news:C0062A7E-AF43-4218-81A7-51E8F3D40528@microsoft.com...
> > hi ,
> >
> >
> > I am building a VC++  application, in which i am using MSXML 6 parser.
> The
> > problem i am facing the memory consumption by the application. I had
> profiled
> > the application using AQTime and the profiler shows the increase the
> memory
> > consumption by the MSXML6.dll. Once the xml related task is over the
> memory
> > occupied by the application should get release but that does not happen
> and
> > the major part of memory is occupied by the MSXML6.dll .
> >
> > The basic outline of the application:
> >
> > 1. Starts the application ( average memory consumption at this stage is
> ~20MB)
> > 2. Starts a new thread ( for handling the XML function)
> > 3. Initializes the IXMLDOMDocument.
> > 4. Performs the xml related operations ( loading, reading- writing ,
> saving
> > the xml file )
> > ( When the application is in stage 4 ( mentioned above ) the memory
> > consumtion continuously increases.)
> > 5. Once the required xml task is over , releases the xmldomdocument
> > objectthe thread exits but still the memory consumtion is same.
> > 6. The memory is released only after the application is closed.
> >
> >
> > I searched a lot on the net about this problem but couldnt get the correct
> > solution.
> >
> > Can anyone suggest what to do?
> >
> 
> Having got passed step 1 have you tried having your app repeat steps 2 to 5
> several times before closing the app.  Does it "leak memory" by the same
> significant amount on each pass or after the first or second pass does the
> allocated amount of memory stabilise?
> 
> MSXML manages its own heap of memory for collecting nodes, this memory is
> shared by all documents.  It has a form of GC to manage this heap.  It also
> permentantly maintains a name table so if you have wide variety of
> namespaces and element names that can get quite big.
> 
> 
> -- 
> Anthony Jones - MVP ASP/ASP.NET
> 
> 
>
date: Tue, 29 Jul 2008 21:54:00 -0700   author:   Tanish

Re: MSXML and memory leak   
"Tanish"  wrote in message
news:0A2BD9E4-95FF-4C59-9DF4-67EE8DB952BB@microsoft.com...
> Hi,
>
> thanks for the response.
>
> Yes, the memory leak in consitent in each pass ( from step 2 to step 5).
I
> had read an article on the GC of MSXML , but it didnt help much.
>
> Can you suggest anything else so that the memory leak problem solved.
>


I was rather expecting you to discover that the memory usage doesn't grow
much after second pass.  It sounds like you do have a genuine memory leak.
Can you post some of your code?  You're sure you are releasing all your
references ok?


-- 
Anthony Jones - MVP ASP/ASP.NET
date: Fri, 1 Aug 2008 23:37:04 +0100   author:   Anthony Jones

RE: MSXML and memory leak   
I have a similar problem with MSXML 4.0 SP2.

My problem is that MSXML is not only allocating large objects in heap 
memory, MSXML is allocating large heaps and not destroying them.  Is that 
what you were seeing in your app as well?

-- Darren --

"Tanish" wrote:

> 1. Starts the application ( average memory consumption at this stage is ~20MB)
> 2. Starts a new thread ( for handling the XML function)
> 3. Initializes the IXMLDOMDocument.
> 4. Performs the xml related operations ( loading, reading- writing , saving 
> the xml file )
> ( When the application is in stage 4 ( mentioned above ) the memory 
> consumtion continuously increases.)
> 5. Once the required xml task is over , releases the xmldomdocument 
> objectthe thread exits but still the memory consumtion is same.
> 6. The memory is released only after the application is closed.
date: Wed, 3 Sep 2008 09:00:01 -0700   author:   Darren Morby

RE: MSXML and memory leak   
I also notice a large leak in my program. has anyone found a solution?

I have a simple XML DOM class -

CComPtr< IXMLDOMDocument > m_pDOMDoc; // variable defined in header file

m_pDOMDoc.CoCreateInstance( __uuidof( DOMDocument), NULL, 
CLSCTX_INPROC_SERVER); // called in the constructor
..
m_pDOMDoc->load // used in one of the methods

I do not see memory being released after the destructor is called. What 
should I do to make sure that memory gets released?


"Darren Morby" wrote:

> I have a similar problem with MSXML 4.0 SP2.
> 
> My problem is that MSXML is not only allocating large objects in heap 
> memory, MSXML is allocating large heaps and not destroying them.  Is that 
> what you were seeing in your app as well?
> 
> -- Darren --
> 
> "Tanish" wrote:
> 
> > 1. Starts the application ( average memory consumption at this stage is ~20MB)
> > 2. Starts a new thread ( for handling the XML function)
> > 3. Initializes the IXMLDOMDocument.
> > 4. Performs the xml related operations ( loading, reading- writing , saving 
> > the xml file )
> > ( When the application is in stage 4 ( mentioned above ) the memory 
> > consumtion continuously increases.)
> > 5. Once the required xml task is over , releases the xmldomdocument 
> > objectthe thread exits but still the memory consumtion is same.
> > 6. The memory is released only after the application is closed.
>
date: Thu, 25 Sep 2008 13:35:03 -0700   author:   OpenDev2008

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us