[Home] [By Thread] [By Date] [Recent Entries]

  • To: xml-dev@l...
  • Subject: RE: Unloading XML file from DOM
  • From: Ashish Goyal <ashishgoyal_26@y...>
  • Date: Mon, 7 Jan 2002 13:13:17 -0800 (PST)
  • In-reply-to: <FBCE6C0E0C75D4119AF100508BB010BB0584AE62@m...>

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..
--- david.hunter@m... 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
> david.hunter@m...
> http://www.mobileq.com
> 
> 
> -----Original Message-----
> From: Ashish Goyal [mailto:ashishgoyal_26@y...]
> 
> Sent: Saturday, January 5, 2002 12:35 AM
> To: xml-dev@l...
> Subject:  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/

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member