1401585 - Memory leak in ReportViewerBean Crystal Reports for Eclipse 2.0

SAP Knowledge Base Article - Public

1401585 - Memory leak in ReportViewerBean Crystal Reports for Eclipse 2.0

Symptom

When opening the ReportViewerBean multiple times, the instances do not get garbage collected.

Reproducing the Issue

  •  Crystal Report for Eclipse 2.0 

Use the following code to reproduce the issue.

@Test
    public void testMemUsageOfRawCrystal() throws Exception {
        for (int i = 0; i < 1000; i++) {
            // block 1
            ReportViewerBean reportViewerBean = new ReportViewerBean();
            reportViewerBean.setHasRefreshButton(false);
            reportViewerBean.init();
            reportViewerBean.start();
 
            // block 2
            ReportClientDocument reportClientDocument = new ReportClientDocument();
            reportClientDocument.setReportAppServer(ReportClientDocument.inprocConnectionString);
            reportClientDocument.open(file, OpenReportOptions._openAsReadOnly | OpenReportOptions._discardSavedData);
 
            // block 3
            reportClientDocument.getReportSource().dispose();
            reportClientDocument.close();
            reportClientDocument = null;
 
            // block 4
            reportViewerBean.stop();
            reportViewerBean.destroy();
            reportViewerBean = null;
        }
    }

Resolution

This issue has been escalated and it has been assigned TE 5000162267

Keywords

KBA , BI-DEV , Business Intelligence Software Development Kits (SDKs) , Bug Filed

Product

Crystal Reports, version for Eclipse 2.0