已超出 Notes 可支持的最大内存段数
我正在使用 Domino.dll 访问 C#.NET 2.0 中的 NSF 文件
我使用多线程一次访问 4 个 NSF 文件,对于小型 NSF 文件工作正常,但如果我尝试访问大型 NSF 文件,我会得到内存不足异常和已超出 Notes 可支持的最大内存段数。
当我在 while 循环中从大型 NSFVIewFolder 访问 NotesDocument 对象时,通常会发生此异常。
我正在使用 Marshal.ReleaseComObject(NotesDocument); 释放 NotesDocument 的实例。它仍然抛出相同的异常。
我的目标是一次访问多个 NSF 文件(一次最多 4 个 NSF 文件),以获取大型 NSF 文件(可能以 GB 为单位)。
I am using Domino.dll to access a NSF file in C#.NET 2.0
I am using multiple thread to access 4 NSF files at a time, its working fine for small NSF files, but if i try to access large NSF files i get the Out of Memory Exception and Maximum number of memory segments that Notes can support has been exceeded.
This exception usually occurs when i access NotesDocument object from a large NSFVIewFolder in a while loop.
I am releasing the instance of the NotesDocument by using the Marshal.ReleaseComObject(NotesDocument); still it throws the same exception.
My goal is to access multiple NSF files at a time (MAX 4 NSF files at a time) for large NSF files (may be in GB).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不熟悉 C# 接口,但使用 Java,您需要在继续下一个文档之前显式调用笔记文档上的 recycle() 方法。如果不这样做将意味着与注释文档相关的资源将不会被清理。
I am not familiar with the C# interface, but with Java, you need to explicitly call the recycle() method on the notes document before proceeding to the next document. Failure to do this will mean the associated resources with the notes document will not be cleaned up.
您的问题与此问题类似。您使用什么版本的 Domino 来访问数据库?您需要有效地销毁该对象。我不认为 ReleaseComObject 有效地释放了服务器也用来向 COM 提供数据的内存,因此内存不足。
我建议您尝试使用 Java 来执行此操作,因为内存管理比 COM 得到更好的支持。
这篇文章和这个应该有助于为 Domino 编写 Java。 这个简单示例让您了解如何通过文档集合。
Your issue is similar to this problem. What version of Domino are you using to access the database ? You need to effectively destroy the object. I don't think that ReleaseComObject is effectively releasing the memory that the server would also use to provide the data to COM, thus running out of memory.
I suggest you try Java to do this as the memory management is much better supported than COM.
This article and this one should help write Java for Domino. This simple example gives you an idea of how to get through a document collection.