on 02-28-2015 12:43 PM
SAP Crystal Reports runtime engine for .NET Framework (64-bit) - 214MB - 13.0.13.1597
SAP Crystal Reports, version for Microsoft Visual Studio - 533MB - 13.0.13.1597
int index = 0;
while (index < 36000)
{
index++;
using (var crReport = new CrystalDecisions.CrystalReports.Engine.ReportDocument())
{
crReport.Load("report.rpt");
}
}
Hi,
when i execute these rows of code , after 32767 loop , i get: "Memoria insufficiente" ("Out of memory")
Thanks,
P.
Hi PB,
Why are you loading 32K reports without closing them?
You won't be able to do anything with that many reports open anyway.
Max reports open should be less than 50. But that's just a guess....
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How about adding .Close and .Dispose ?
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
for .Close and .Dispose confided on the instruction "Using" (one of the tests was to explicitly call .Close and .Dispose but the result is not changed); the code above was just an example to cause the error locally, i don't need to open 36k reports, the real case is a wcf service on IIS which on request creates a .pdf and send it by email; after countless executions when the error occurs i have to execute a recycling of IIS .
Thanks,
PB
Hi PB,
OK, there is likely a 32k limit to the number of report objects so have a closer look at your code to see why you are hitting that limit. Technically you should not have more the say 50 report objects in session so possibly you are not closing the session either. Or from your sample its simply because you are not using Sessions....
You may want to specifically call GC.Collect also to for .NET to release the memory.
Microsoft also highly recommends cycling IIs because Windows can't defrag memory on the fly like UNIX os's can. So the memory is set back to a reboot may be required. CR must have contiguous memory space to allocate it's memory requests.
Don
Hi Don ,
I have already tried the GC.Collect and also to use a page file 1.5 times the size of the memory ; I tried to conduct surveys because I thought something wrong or not to call some method that could reset the situation , but if there is actually a limit ok "no problem" honestly , I'll increase the frequency of recycle IIS . Thanks anyway for your attention sincerely , PB .
Hi PB,
There is still something funny going here though.... No one ever runs into that limit, I recall there was one other and he was simply testing to see how far he could get...
We have a reg key that limits the number of jobs and the default is 75 so how you get that high up is very strange...
Something is being cached somewhere in IIS and not releasing the Jobs...
Fiddler may tell you but...
Good luck
Don
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.