Symptom
- Running the code bellow 100 times results in 100 GCHandles left in memory
{
using (CrystalReport1 report = new CrystalReport1())
{
ReportDocument.Close()
ReportDocument.Dispose()
GC.Collect
}
DataSet.Clear();
}
Environment
- Crystal Reports for Visual Studio 2010
- VS2010
Reproducing the Issue
- Create a report with no database connection or any other objects
- Open Task Manager
- Run the report using the code given in the Symptom section
- Task Manager shows that the number of handles in use by the w3wp process increases with each report run
- Number of handles does not decrease on use of Close and Dispose methods
- VS .NET Memory Profiler shows that the object being left behind is a handle of type CrystalDecisions.CrystalReports.Engine.ReportDocument.EventCallback
- Using sysinternals' handle.exe, the handles show up as:
1324: Mutant \Sessions\1\BaseNamedObjects\CrystalReportXalanInitilizeMutex2916l
Resolution
- This issue is resolved in Service Pack 2 for Crystal Reports for Visual Studio 2010
- ADAPT01573472
Keywords
CR2010 2010 CR4VS2010 CR4VS VS2010 NET2010 Crystal Reports for .NET Framework 4.0 crforvs 13 handle leak corrupt , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , Problem
Product
SAP Crystal Reports, developer version for Microsoft Visual Studio