問題描述
我使用存儲過程 sp_xml_preparedocument
打開了很多大型 XML,并且我關閉了 SSMS 上的選項卡,而沒有調用 sp_xml_removedocument
來釋放內存.
I have opened a lot of large XML using the stored procedure sp_xml_preparedocument
, and I close the tab on SSMS without calling sp_xml_removedocument
to release the memory.
因此,現在當我嘗試使用以下代碼解析另一個 XML 時:
As a result, now when I try to parse another XML using following code:
EXEC sp_xml_preparedocument @idoc OUTPUT, @result
我收到此錯誤:
無法創(chuàng)建 XML 文檔,因為服務器內存不足.使用 sp_xml_removedocument 釋放 XML 文檔
XML document could not be created because server memory is low. Use sp_xml_removedocument to release XML documents
但是由于我沒有存儲句柄,我如何釋放打開的 XML 所持有的內存?會話已關閉,我無法再獲取句柄...
But since I did not store the handles, how could I release the memory held by the opened XML? The session has been closed, and I cannot get the handle anymore...
附言我不敢相信,如果您調用 sp_xml_preparedocument
并忘記使用 sp_xml_removedocument
關閉它,該文件將永遠保留在內部緩存中.這是真的嗎?
P.S. I cannot believe that if you call the sp_xml_preparedocument
and forget to close it using sp_xml_removedocument
, the file will stay in the internal cache forever. Is that real?
推薦答案
看來這個問題的唯一解決方案是重新啟動服務器.錯誤重啟后消失.
It seems like that the only solution to this problem is to restart the server. The error disappeared after reboot.
這篇關于SQL Server中如何釋放用于解析XML字段的內存的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!