Crystal Reports ExportToStream内存泄漏 [英] Crystal Reports ExportToStream Memory Leak

查看:91
本文介绍了Crystal Reports ExportToStream内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在跟踪内存泄漏一段时间。我已将其隔离到非托管内存,并且似乎在Crystal Reports ExportToStream 方法中(使用Crystal Report XI Release 2,VS 2005,.NET 2.0)。 />


我的服务以pdf的形式生成大量报告,大约10,000我的内存不足。请注意,我的报告相当大(约18页),但我目前每份报告泄漏约33,000。我的数据集和报表对象都包含在使用中,并且所有托管内存堆都会被检查。主要罪魁祸首似乎是ExportToStream。



以下是示例代码:



I've been tracking down a memory leak for a little while now. I have isolated it to unmanaged memory, and what appears to be inside Crystal Reports ExportToStream method (using Crystal Report XI Release 2, VS 2005, .NET 2.0).

My service produces a large number of reports as pdf's, and at about 10,000 I'm running out of memory. Mind you, my report is rather large (approximately 18 pages), but I'm currently leaking approximately 33k per report. My datasets and report objects are wrapped in usings, and all managed memory heaps are kept in check. The main culprit appears to be ExportToStream.

Here's the sample code:

using (DataSet dst = new DataSet())
{
    dst.ReadXml(@"c:\temp\data.xml", XmlReadMode.ReadSchema);

    using (ReportClass rpt = new TestReport())
    {
        rpt.SetDataSource(dst);
        rpt.Refresh();

        using (Stream stm = rpt.ExportToStream(ExportFormatType.PortableDocFormat))
        {
            // ...
        }

        rpt.Close();
}





如果我注释掉ExportToStream,我的托管和非托管内存都可以。如果我把它留进去,我的非托管内存就会增长,直到我最终用完为止。



我目前正在使用MemProfiler跟踪内存,它提出了有EventHandler保持连接,并且没有被释放。唯一的问题是它似乎在Crystal Reports代码中很深。它抱怨 InternalEnterpriseLogonInfo - ReportID - ReportClientDocumentWrapper 上的事件。有没有其他人经历过这个?



这些事件与此处报告的旧Crystal事件错误不同:

[水晶内存泄漏]



我的下一个想法是试图强迫它以某种方式在它自己的内存空间中运行,但我不知道该怎么做。



关于解决方案或解决方法的任何想法?



If I comment out the ExportToStream, my managed and unmanaged memory is fine. If I leave it in, my unmanaged memory grows until I eventually run out.

I'm currently using MemProfiler to keep track of the memory, and it brought up that there are EventHandlers that remain attached, and are not being released. The only problem is that it appears to be deep in Crystal Reports code. It's complaining about events on InternalEnterpriseLogonInfo - ReportID - ReportClientDocumentWrapper. Has anyone else experienced this?

These events are different than the old Crystal events bug as reported here:
[Crystal memory leak]

My next thought is to try to force this to run in it's own memory space somehow, but I'm not sure how to do that.

Any ideas on a solution or work around?

推荐答案

您使用的是哪个版本的Visual Studio和.NET? ? IIRC,XI R2仅在.NET 1.0和1.1(VS 2002和2003)上受支持。我可能错了,因为我不使用CR。问题太多了! ;)
Which version of Visual Studio and .NET are you using? IIRC, XI R2 was only supported on .NET 1.0 and 1.1 (VS 2002 and 2003). I could be wrong as I don't use CR. Too many problems with it! ;)


这是一个已知的错误。直到现在还没有解决方法。抱歉。
It is a known bug. No workaround till now. Sorry.


任何人都找到了解决此问题的方法吗?
Any one found any solution for this issue ?


这篇关于Crystal Reports ExportToStream内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆