[
Lists Home |
Date Index |
Thread Index
]
- To: xml-dev@lists.xml.org
- Subject: RE: [xml-dev] Unloading XML file from DOM
- From: Ashish Goyal <ashishgoyal_26@yahoo.com>
- Date: Mon, 7 Jan 2002 13:13:17 -0800 (PST)
- In-reply-to: <FBCE6C0E0C75D4119AF100508BB010BB0584AE62@mqtorex1.toronto.mobileq.com>
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@mobileq.com 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@mobileq.com
> http://www.mobileq.com
>
>
> -----Original Message-----
> From: Ashish Goyal [mailto:ashishgoyal_26@yahoo.com]
>
> Sent: Saturday, January 5, 2002 12:35 AM
> To: xml-dev@lists.xml.org
> 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/
|