Next in thread → Next in month →

RE: [xml-dev] Unloading XML file from DOM

From
Ashish Goyal <>
To
Date
2002-01-07T21:13:17Z
ID
<>
Thread
RE: [xml-dev] Unloading XML file from DOM
Yeah..I did the same thing..I called Release() and
then again CoCreateInstance() but nothing happened..I
think there is memory leaks  in MSXML ..
I guess I have to live with it.. :(
There is no KB also for this at microsoft site..
---  wrote:
> [Replying off-list]
> 
> You don't need to unload the previous document.  As
> soon as you call load()
> or loadXML(), whatever is currently in the DOM will
> be unloaded
> automatically, before MSXML tries to load the new
> document.  If you have
> memory leaking, I don't think this is your problem.
> 
> Alternatively, if you really want to make sure, you
> can simply kill your
> reference to the DOMDocument object as soon as
> you're done with it, and
> create a new one when needed.  For example, in VB
> syntax you might do
> something similar to this:
> 
> Public Sub Blah()
>     Dim xdDoc As MSXML2.DOMDocument
>     
>     Set xdDoc = New MSXML2.DOMDocument
>     xdDoc.async = False
>     xdDoc.Load "url"
>     
>     'work with the data
>     
>     'when you're done with the data, get rid of the
> DOMDocument object
>     Set xdDoc = Nothing
>     
>     'when you need to load more data, instantiate a
> new DOMDocument object
>     Set xdDoc = New MSXML2.DOMDocument
>     xdDoc.async = False
>     xdDoc.Load "new url"
>     
>     'work with the new data
>     
>     'when you're done with the data, get rid of the
> object again
>     Set xdDoc = Nothing
>     
>     'etc.
> End Sub
> 
> *Depending on the type of code you're writing*,
> killing COM objects as soon
> as you're done with them *can* improve scalability.
> 
> David Hunter
> Senior Architect
> ViaFone
> Author:  Beginning XML
> 
> http://www.mobileq.com
> 
> 
> -----Original Message-----
> From: Ashish Goyal [mailto:]
> 
> Sent: Saturday, January 5, 2002 12:35 AM
> To: 
> Subject: [xml-dev] Unloading XML file from DOM 
> 
> 
> Hi ALl,
>   I am loading a XML file in my program and I am
> using
> load() method but I could not find method to unload
> the file. I am loading various file and therefore
> needs to unload the previous files. Without this my
> memory usage goes very high. Any help would be
> great..I am using MSXML 3.0 with SP2 on WIN2000.
> 
> Thanks
> Ashish
> 
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
> 
>
-----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org
> <http://www.xml.org>, an initiative
> of OASIS <http://www.oasis-open.org>
> 
> The list archives are at
> http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the
> subscription
> manager: <http://lists.xml.org/ob/adm.pl>


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
Next in thread → Next in month →