tharstern
asked on
How to release memory when the parameter dialog appears in Crystal Reports 2008
We are using Crystal Reports 2008 SP5 in VS2008.
One of our users found that after running a lot of reports (50+) that the memory of our application had increased considerably.
To track the issue I created a simple app that displays a report from a path. There is no database connection in the report.
Running the report once loads all the dll's into memory.
If the report doesn't include a parameter then after running the report a second time the memory returns to what is was.
Change the report to now include a parameter and running the app again.
The parameter select dialog will now appear each time the report is run.
Running the report once loads all the dll's into memory.
After running the report a second time all the memory isn't released. It increased by about 2,000KB
If we keep running the report that displays the parameter dialog the memory keeps increasing and is never released.
We use the ReportDocument.Close() and ReportDocument.Dispose() and GC.Collect(), which does release the memory if there are no parameters.
I also tried running the report directly within Crystal Reports 2008 with the same results.
Is there something else needed to be done to dispose of the memory when parameters are displayed?
One of our users found that after running a lot of reports (50+) that the memory of our application had increased considerably.
To track the issue I created a simple app that displays a report from a path. There is no database connection in the report.
Running the report once loads all the dll's into memory.
If the report doesn't include a parameter then after running the report a second time the memory returns to what is was.
Change the report to now include a parameter and running the app again.
The parameter select dialog will now appear each time the report is run.
Running the report once loads all the dll's into memory.
After running the report a second time all the memory isn't released. It increased by about 2,000KB
If we keep running the report that displays the parameter dialog the memory keeps increasing and is never released.
We use the ReportDocument.Close() and ReportDocument.Dispose() and GC.Collect(), which does release the memory if there are no parameters.
I also tried running the report directly within Crystal Reports 2008 with the same results.
Is there something else needed to be done to dispose of the memory when parameters are displayed?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try to add
GC.WaitForPendingFinalizer s()
after GC.Collect() to see if this will change something
GC.WaitForPendingFinalizer
after GC.Collect() to see if this will change something
ASKER
I added in the GC.WaitForPendingFinalizer s() but unfortunately there is no difference.
ASKER
I can create the issue within Crystal Reports 2008 SP5.
Create a report with no database connection and 1 parameter. Keep refreshing the report and choose "Prompt for new Parameter Values" and the memory keeps increasing and is never released until I close the application.
Does this happen with anybody else?
Using PerfMon and monitoring the Private Bytes.
In Crystal Reports 2008 SP5, after opening the report the Private Bytes were 41,000,000. After refreshing the report 10 times it went up to 65,000,000. After 10 minutes waiting they were still at 65,000,000
I tried the same thing in Crystal Reports XI Release 2 and the memory doesn't increase after refreshing, it stays at around 41,000,000.
Does anybody know if the same thing happens in Crystal Reports 2011? If not then we may have to upgrade.
Create a report with no database connection and 1 parameter. Keep refreshing the report and choose "Prompt for new Parameter Values" and the memory keeps increasing and is never released until I close the application.
Does this happen with anybody else?
Using PerfMon and monitoring the Private Bytes.
In Crystal Reports 2008 SP5, after opening the report the Private Bytes were 41,000,000. After refreshing the report 10 times it went up to 65,000,000. After 10 minutes waiting they were still at 65,000,000
I tried the same thing in Crystal Reports XI Release 2 and the memory doesn't increase after refreshing, it stays at around 41,000,000.
Does anybody know if the same thing happens in Crystal Reports 2011? If not then we may have to upgrade.
ASKER
Writing our own interface would solve this but I was hoping to carry on using the standard prompt.
We're using the CrystalViewer on a form. We set the CrystalViewer.ReportSource