使用 ActiveReports 创建报表时 IIS WCF 服务中的内存问题
我们需要通过 IIS 中托管的 WCFService 按计划自动生成报告。该报告是使用 ActiveReports 创建的。以前,我们通过计算机中的 Windows 应用程序生成报告。我们当前遇到的问题是内存不足异常。当我们尝试运行 2MB 报告时,它工作正常,但当我们尝试运行 4MB 报告时,它无法处理。它抛出内存不足异常。我们的服务器有4GB RAM,8GB虚拟内存和windows7操作系统。请建议我们如何解决这个问题。
We have a requirement to generate reports automatically on schedule basis through WCFService hosted in IIS. The report is created using ActiveReports. Previously, we were generating report through a windows application in our machine. The issue that we are currently encountering is out of memory exception. When we try to run 2MB reports, it works fine but when we try to run 4MB reports, it is not processing. It throws out of memory exception. Our server has 4GB RAM, 8GB virtual memory and windows7 OS. Please advice us on how to solve this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然,如果您有可用内存并且报告确实 2-4MB,那么报告就会运行。我怀疑该报告的内存远远超过 2-4MB,或者机器没有太多可用内存。查看正在发生的情况的一个好方法是运行内存分析器,例如 蚂蚁或dotTrace。请记住,除了要为报表加载的数据之外,报表页面中的任何图像或内容也将存储在内存中。如果将其导出为另一种格式(例如 PDF),则需要一些额外的开销来将该 PDF 保存在内存中。
此外,我们现在还提供 ActiveReports Server,它内置了调度和 Web 服务,用于请求特定格式的报告(显然是通过 WCF 实现的)。它将根据需要通过自动排队、缓存和负载平衡报告执行来处理可扩展性。您还可以从 Developer Edition 上传 ActiveReports .rpx 报告并立即启动并运行。只需确保报告的所有代码都独立包含在 .rpx(脚本)中。
Obviously if you have the available memory and the report is really 2-4MB then the report will run. I suspect the report is much more than the 2-4MB in memory or the machine doesn't have much memory available. A good way to see what is going on is run a memory profiler like Ants or dotTrace. Keep in mind that in addition to the data you're going to load for the report, any images or content in the pages of the report will also be in memory. And if you export it to another format like PDF, there will be some additional overhead to hold that PDF in memory.
Also, we now offer ActiveReports Server too which has built in scheduling and web services for requesting reports in a specific format (implemented via WCF obviously). It will deal with scalability by automatically queuing, caching, and load balancing report executions as needed. You can also upload your ActiveReports .rpx reports from the Developer Edition and get up and running right away. Just make sure all the code for your report is self-contained in the .rpx (script).