|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: 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.. --- 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/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








