cancel
Showing results for 
Search instead for 
Did you mean: 

Correct way to dispose of an ASP.NET CR page?

Former Member
0 Kudos

I recently upgraded an older CR ASP.NET site for a client from .NET 1.1 to .NET 3.5 and Visual Studio 2010, using the CRforVS_13_0_3.exe . Upgraded site seems to work fine in test where the user count is low but as soon as it's deployed to production (100-200 concurrent users) within minutes the server memory reaches GBs and the site becomes unusable. We've already had to roll back twice.

I'm not sure where the memory leak is coming from. In the Unload event I .Close/.Dispose of the CrystalReportViewer.  The only hint I've been able to find in the discussion forums is to try adding a GC.Collect() after the dispose.

On an additional note, I have log4net set up and I see a lot of ParameterFieldCurrentValueExceptions getting logged. I'm trying to use the builtin JavaScript dynamic parameter prompting fields but I need to fill in one specific parameter with value based on the user's login account. The rest should be prompted to the user.

Could someone either give me a rundown on the required steps to start/build/dispose of a CR control and/or link to it using VS2010 (all the links I tend to find are outdated.)

I'd really appreciate any help, thanks,

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hello Nicholas

It is really not the viewer to worry about as far as .close and .dispose goes. It is the report object that consumes memory. So on the Unload event, do .dispose and .close on the report object.

Also, remember that the CR print engine is limited to three concurrent processor licenses ( no way to increase this). In other words, requests from three users will be processed at any one time. There is also a 75 print job limit. See the article Crystal Reports Maximum Report Processing Jobs Limit for more details.

Finally, make sure you are using SP4 for Crystal Reports for Visual Studio 2010. If both issue persist after you apply SP 4, break up this thread and create a new one re. the parameters issue. (for ease of searching, clarity and so on, it's good to have separate issues in separate threads).

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

I mistyped, it was the report object I was close/disposing, not the viewer. Is the GC.Collect() call the recommended solution? I saw it in another thread and I've added it but I'm not sure if it's the fix or not.

I was unaware of the print engine limit. I haven't seen those error messages in our logs yet but I'll take steps now from the document you linked to cover that base anyway.

We're also upgrading to the SP4 version from SP3 and will see if that helps.

If further questions arise over the parameters I'll open a new thread for them.

Thanks Ludek,

  --  Nick

former_member183750
Active Contributor
0 Kudos

I think in the early days of .NET GC.Collect was recommended  - at least by us anyhow, but not necessary anymore.

Let's keep our fingers crossed for SP4

Have a great weekend,

- Ludek

Answers (0)