Windows 2008 R2 Web 服务器上的 .NET Web 应用程序只能寻址 16 GB RAM,而不是 32 - 为什么?
我们正在尝试运行一个 .NET 4 Web 应用程序(在 8 GB、8 核 Windows 2008 R2 64 位 Webedition 服务器上),该应用程序使用 Spire.doc 创建 Word 邮件合并文档。大约 5,000 条记录时一切正常。如果我们尝试合并更多内存,物理内存和虚拟内存都会耗尽所有内存,每个内存大约 8 GB。
问题:根据 http://msdn.microsoft.com/en-us/library/aa366778%28v=vs.85%29.aspx#physical_memory_limits_windows_server_2008_r2,Windows 2008 R2 64 位将为您提供32 GB。
那么如何让应用程序使用更多虚拟内存呢?
这是代码,但我认为这个问题相当笼统(是的,创建 10,000 页的 Word 文档可能看起来很荒谬,但这正是客户想要的,是的,我们会说服他放弃它):
private static void Merge(DataTable recipients, string template, string saveAs)
{
Document document = new Document();
document.LoadFromFile(template);
document.MailMerge.Execute(recipients);
document.ViewSetup.DocumentViewType = DocumentViewType.PrintLayout;
document.SaveToFile(saveAs, FileFormat.Doc);
}
We are trying to run a .NET 4 web application (on an 8 GB, 8 core Windows 2008 R2 64bit Webedition server) that creates Word mailmerge documents, using Spire.doc. Everything works fine up to around 5.000 records. If we try to merge more, physical as well as virtual memory both consume all they can, around 8 GB each.
Question: according to http://msdn.microsoft.com/en-us/library/aa366778%28v=vs.85%29.aspx#physical_memory_limits_windows_server_2008_r2, Windows 2008 R2 64bit would give you 32 GB.
So how can I make the application use more virtual memory?
Here's the code, but I think the question is rather generic (and yes, creating Word documents with 10.000 pages may seem ridiculous, but this is what the customer desires, and yes, we will talk him out of it):
private static void Merge(DataTable recipients, string template, string saveAs)
{
Document document = new Document();
document.LoadFromFile(template);
document.MailMerge.Execute(recipients);
document.ViewSetup.DocumentViewType = DocumentViewType.PrintLayout;
document.SaveToFile(saveAs, FileFormat.Doc);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试在 x64 模式下编译您的 Web 应用程序。
You could try to compile your web application in in x64 mode.