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
Keywords
KBA , BI-DEV , Business Intelligence Software Development Kits (SDKs) , Bug Filed