Enjoying using Gregor’s U2 XDOM wrapper. One thing I learned dealing with a large DOM tree is XDOMClose() does not free the memory when the program ends.
A monthly run of my current ETL will use quite a bit of memory, and two runs will abend my session.
Seems like a good idea to delete the root node before closing it to ensure we done have a memory leak.
Even though it sounds reasonable, it is not effective. Not sure exactly how to do this. Looks like a support call to Rocket is in order.
*****************
CLOSE.DOM.HANDLE:
*****************
* Output the XML
MSG = "Starting DOM Write"; CALL CLOGGER(MSG,LOGGING.NS,"DEBUG","")
xml.foutname = 'ggddt_':RUN_ID:".xml"
xmlStatus = XDOMWrite(domHandle, xml.foutname, XML.TO.FILE)
MSG = "Finished DOM Write"; CALL CLOGGER(MSG,LOGGING.NS,"DEBUG","")
* Explicitly remove the DOM tree from memory, closing doesnt do it.
xmlStatus = XDOMRemove(domHandle, '/GGDDT', '', '', JUNK)
IF xmlStatus XML.SUCCESS THEN GOSUB HANDLE.XML.ERROR
xmlStatus = XDOMClose(domHandle)
RETURN
Leave a comment