How to release the memory used to parse XML field in SQL Server(SQL Server中如何释放用于解析XML字段的内存)
问题描述
我使用存储过程 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
我收到此错误:
无法创建 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字段的内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SQL Server中如何释放用于解析XML字段的内存


基础教程推荐
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01