I need to find out more info and haven't had any luck.
What happens to the memory allocated for a XML document when a query uses sp_xml_preparedocument and then the proc sp_xml_RemoveDocument isn't used.
I am not looking for an alternative to using the XML prepare document. I know there are alternatives.
If a query uses sp_xml_preparedocument and the memory is allocated, I can see those documents with handles pretty easily using Select * from sys.dm_exec_xml_handles(0)
That shows me info about the XML documents. But what if the connection that originally created the document is no longer active or the query ended and connection is closed.
when the connection is closed, does the memory get released? does it leak somewhere and become unavailable?
Most importantly, If the memory is still being held somewhere (or leaked and lost) how do I identify it and get it release?