SSRS - OutOf MemoryException - 可以显示的行数是否有限制

发布于 2024-07-13 18:09:14 字数 992 浏览 11 评论 0原文

我创建了一个 rdl 文档,它指向一个返回 90 000 行的过程,但我遇到了内存不足的异常。 报表项目可以处理的行数是否有限制?

目前,我已经更改了驱动我的报告的过程,只选择前 90 000 行。我的规格是能够创建包含 120 000 行的报告。 我的报告是一个矩阵。

我发誓上周我生成了一份包含 106800 行的报告,但现在突然我不能了。

我已经编写了一个渲染扩展,这是我进入代码时出现的异常的一部分。

电子信息:2009年2月12日12:03:53 PM PrairieFyre.ReportActions.RenderReport:渲染报告时出错 Microsoft.Reporting.WinForms.LocalProcessingException:错误 发生在本地报告处理期间。 ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: 报表处理中发生意外错误。 ---> System.OutOfMemoryException:异常类型 抛出“System.OutOfMemoryException”。 在 System.IO.MemoryStream.set_Capacity(Int32值)位于 System.IO.MemoryStream.EnsureCapacity(Int32 值)位于 System.IO.MemoryStream.Write(Byte[]缓冲区,Int32偏移量,Int32计数) 在 System.IO.BinaryWriter.Write(字符串值)处 Microsoft.ReportingServices.ReportProcessing.Persistence.IntermediateFormatWriter.ReportServerBinaryWriter.WriteString(字符串 字符串值)....

I have created an rdl doc that points at a proc that returns 90 000 rows and I am getting an out of memory exception. Is there a limit to how many rows the report projects can handle?

Currently I have changed the proc that drives my report to just do a select Top 90 000. My specs are to be able to create a report with 120 000 rows. My report is a matrix.

I swear last week I generated a report that has 106800 rows in it but now all of sudden I can't.

I have written a rendering extension and here is part of the exception when I step into the code.

eInfo: 2/12/2009 12:03:53
PM prairieFyre.ReportActions.RenderReport: Error rendering report
Microsoft.Reporting.WinForms.LocalProcessingException: An error
occurred during local report processing. --->
Microsoft.ReportingServices.ReportProcessing.ReportProcessingException:
An unexpected error occurred in Report Processing. --->
System.OutOfMemoryException: Exception of type
'System.OutOfMemoryException' was thrown. at
System.IO.MemoryStream.set_Capacity(Int32 value) at
System.IO.MemoryStream.EnsureCapacity(Int32 value) at
System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.BinaryWriter.Write(String value) at
Microsoft.ReportingServices.ReportProcessing.Persistence.IntermediateFormatWriter.ReportServerBinaryWriter.WriteString(String
stringValue) ....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梨涡少年 2024-07-20 18:09:14

我认为除了硬件配置之外没有任何限制。 如果您在 32 位计算机上,处理此问题的工作进程的可用内存少于 2 GB,当您考虑内核模式内存时,可能接近 1 GB。 如果您要提供像这样的大型报告,您可能需要 64 位设置,并且机器上至少有 4 GB 或更多内存。 此设置将允许工作进程分配超过 2 GB 的可用内存来毫无问题地完成这些大型请求。

如果无法选择硬件升级,您也可以考虑这些替代方案。

  • 您说该报告是一个矩阵报告,因此听起来您没有向用户显示所有数据,而是将其聚合。 您能否在数据库中预先聚合一些数据,然后仅使用 SSRS 进行显示?

  • 由于报告只不过是一个 XML 文件,因此请从 SQL Server 内部或使用某些脚本或进程构建报告 XML 字符串。 这可能需要大量工作。

I don't think there is a limitation, other than your hardware configuration. If your on a 32-bit machine the worker process that is processing this has less than 2 gigabytes of memory to work with, probably closer to 1 gigabyte when you factor in kernel mode memory. If your going to be serving up large reports like this, you probably need a 64-bit setup with at least 4 gigs of memory or more on the box. This setup will allow the worker process to allocate more than 2 gigs of usable memory to complete these large requests without issue.

If a hardware upgrade is not an option you can also consider these alternatives.

  • You said the report was a matrix report so it sounds like you are not displaying all that data to user but aggregating it. Could you pre-aggregate some of this data in the database and then just use SSRS for the display?

  • Since the report is nothing more than an XML file, build the report XML string from within SQL server or by using some script or process. This may be a lot of work.

指尖凝香 2024-07-20 18:09:14

堆栈指示用于存储报表执行结果的 MemoryStream 不能增加(双倍)其大小。

这通常是由地址空间碎片引起的,通常无法通过添加硬件来解决。

Microsoft ReportViewer 可以处理的数据量受到限制,因为它旨在将中间报表执行结果存储在 MemoryStream 中,不幸的是,该内存流需要呈二次方增长的连续可用地址空间,这在通常的 .NET 应用程序中(2GB 地址空间) )不大于 256MB,并且通常比这小得多。

例如,在此流中,存储了所有字段值、聚合值、表达式和图像,因此大小直接取决于添加到报表中的数据集的大小。

要分析 .NET 应用程序的地址空间和对象,最好使用 WinDBG(Windows 调试工具)和 SOS 扩展进行调试。

分析地址碎片的有用命令有:

  • !address -summary
  • lm
  • !EEHeap -gc
  • !DumpHeap -stat

在这种特殊情况下,可以通过预先聚合数据源中已有的值而不是数据源中的值来减少数据量。矩阵。

知识库文章“使用 SQL Server Reporting Services 时可能会收到“System.OutOfMemoryException”错误消息”[1] 中提供了更多提示。

[1]:http://support.microsoft.com/kb/909678“系统。使用 SQL Server Reporting Services 时出现“OutOfMemoryException”错误消息

The stack indicates that the MemoryStream used to store the report execution result cannot increase (double) it's size.

This is usually caused by address space fragmentation, which commonly cannot be solved by adding hardware.

Microsoft ReportViewer is limited in the amount of data it can process because it is designed to store the intermediate report execution result in a MemoryStream that unfortunately needs a quadratically growing amount of contiguous free address space, which in a usual .NET application (2GB address space) is no bigger than 256MB, and often much smaller than that.

In this stream, for instance, all field values, aggregated values, expressions and images are stored, so the size depends directly on the size of the data sets added to the report.

To analyze the address space and objects of a .NET application, it is best to debug with WinDBG (Debugging Tools for Windows) and the SOS extensions.

Valuable commands to analyze address fragmentation are:

  • !address -summary
  • lm
  • !EEHeap -gc
  • !DumpHeap -stat

In this particular case, it may be possible to reduce the amount of data by pre-aggregating values already in the data source and not in the Matrix.

Further tips are given by the Knowledge Base article "You may receive the 'System.OutOfMemoryException' error message when you use SQL Server Reporting Services" [1].

[1]: http://support.microsoft.com/kb/909678 "System.OutOfMemoryException" error message when you use SQL Server Reporting Services

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文