从字节打开文档时出错,"分配不良

This article was translated from English: Does it need improvement?
Translated
View the article in English

处理大型 PDF 文档对某些企业来说非常重要。

使用 IronPDF 加载现有 PDF 文件时,IronPDF 会分配一部分内存来存储加载的 PDF。在 32 位上运行的应用程序每个进程的内存限制为 2 GB。加载大于 500 MB 的 PDF 文件可能会超过这一限制,从而导致 "分配不良 "异常。

异常信息:

IronPdf.Exceptions.IronPdfNativeException: 'Error while opening document from bytes: 'bad allocation'.

解决方案

要解决这个问题,请将应用程序设置为在 64 位上运行。