cancel
Showing results for 
Search instead for 
Did you mean: 

Not enough memory exception

Former Member
0 Kudos

Hi,

I'm using CR2008 SP1 and I've developed an application in VB.NET that uses CR Viewer to previewer the reports.

I have the following problem: The users might print/preview more than 50 reports in the application.

When the number of reports opened and being previewed is reaching 50/60 i get the following error on report Load:


CrystalDecisions.Shared.CrystalReportsException: Load report failed. ---> System.Runtime.InteropServices.COMException (0x800003E5): Failed to open report.
   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   --- End of inner exception stack trace ---
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
   at Primavera.Platform.Reports.Engine.ReportEngine.LoadFromCache(String sReport) in C:\prj32\ERP_750\GR\Platform\Componentes\Primavera.Platform.Reports\Engine\ReportEngine.vb:line 3664

I'm running my application under a Windows Vista with 3gb of memory. When this error happens my application is consuming around 650mb of memory and i still have 20% of my memory free.

Is this a limitation of CR2008?

Edited by: Jos Silva on May 20, 2009 8:47 PM - cvan't figure out why this thing doesn't get formated

Edited by: Jos Silva on May 21, 2009 11:06 AM

Edited by: Jos Silva on May 21, 2009 11:13 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

(I had to break the post in two so it would get formatted)

If I try to reuse ReportDocument objects already opened (like a cache of clean ReportDocuments objects) I get the following error when i try to access to it's properties/methods:

CrystalDecisions.Shared.CrystalReportsException: Load report failed. ---> System.Runtime.InteropServices.COMException (0x80041004): Not enough memory for operation.
   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   --- End of inner exception stack trace ---
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.get_Database()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.get_DataSourceConnections()
   at Primavera.Platform.Reports.Engine.ReportEngine.SetDatabaseLocation(ReportDocument& objReport, String& strServer, String& strDatabase, String& strUsername, String& strPassword) in C:\prj32\ERP_750\GR\Platform\Componentes\Primavera.Platform.Reports\Engine\ReportEngine.vb:line 3967

Answers (6)

Answers (6)

Former Member
0 Kudos

Ok, I didn't know that the Crystal engine had a hard coded limitation of 75 print jobs.

I though by changing the PrintJobLimit it would increase the engine limit of print jobs on RAS.

Another things is, when this error happens and o Close and Dispose both ReportDocument and ReportClientDocument the Crystal doesn't clean up the temporary files it creates:

New (27-05-2009 15:46): C:\Users\jose.silva\AppData\Local\Temp\{337DE044-0876-4BB9-ACFC-5BC440D466F7}.rptConMgrCache

New (27-05-2009 15:46): C:\Users\jose.silva\AppData\Local\Temp\GCPVLS01 {95E988B4-E10E-499F-B477-3DE43D4103D5}.rpt

Deleted (27-05-2009 15:46): C:\Users\jose.silva\AppData\Local\Temp\{337DE044-0876-4BB9-ACFC-5BC440D466F7}.rptConMgrCache

It leaves always the *.rpt file behind.

Anyways, thank you both for your time, Ludek and Don.

Former Member
0 Kudos

My problem is that with the 75 limit of print jobs this problem also happens if you start loading reports that are somehow heavy (with more than 2 sub-reports and so on).

I have no way on when to know why the Crystal Engine has crashed due to memory or something else because the exception raised doesn't specify any information about the error.

If you're telling me this behaviour is normal i guess we have different points of view.

For example, if i'm using an application that suddenly crash by no apparent reason I'll not think that this is it's normal behaviour and I would like more information to know why this happened.

And is it normal to stop loading reports when there is still 700mb of free memory to use?

former_member183750
Active Contributor
0 Kudos

I think you need to go through the following resources to better understand the workings of Crystal reports:

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8029cc96-6ff3-2b10-47a2-b30ea790...

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/7025839b-00d4-2b10-33b4-cf0aa9e0...

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40bccdfd-88a6-2b10-1da1-c47a54b6...

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0070692-01a8-2a10-4797-ff0f5f73...

I am also attaching an article that is about to be published re the 75 print job limit.

Other than that, you have a number of options:

1) search the notes database for other solutions:

https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_ossnotes&query=&adv=true

2) search the articles database for other solutions:

https://www.sdn.sap.com/irj/sdn/businessobjects-articles

3) search these forums for solutions

4) see if anyone else jumps in and provides better ideas

5) obtain phone support contract from here:

http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryI...

Ludek

0 Kudos

Hi Joe,

RAS has a hard coded limit of 75 report jobs it can process at one time and was designed this way. This number should actually be lower and set to 50. What it appears you are trying to do is something that stand alone RAS is not capable of doing. You are pushing it to it's limits.

Other options, build in Job limts and report job caching so no more than 50 jobs can run at one time. This number can be adjusted depending on the complexity of the reports.

Move to Business Object Enterprise and use the Report Job Server rather than the RAS server to process reports. The advantage using the Job Server is it spawns a separate process to handle each report and therefore the host application does not run out of memory by job. Each Report job once complete destroys the Job Process and thus releases it's consumed memory.

If you plan on selling a lot of copies of your application you can contact our OEM sales department. There is a standalone version of RAS that runs as a Service and can be enabled to support Round Robin which means you can have multiple RAS servers running and handling all of the report jobs. RAS manages the jobs internally and cycles through each server until it finds one available to process the next job.

One last note: CR is a 32 bit application and therefore it is limited to 3.5 gig of RAM and %60 percent of the total or roughly 2.4 gig of ram. Windows limitations and configuration.

Thank you

Don

Former Member
0 Kudos

And also, if you clone the object (report document) it doesn't raise any execption.

Former Member
0 Kudos

Yes, I will accept that when the system hasn't got any memory available for the process, but not when I still have plenty of memory available for my applications (in my case I still got 700mb and the applicatio nis consuming around 550mb) it should not crash this way.

Specially because it doesn't crash saying it has run out of memory!

And yes, I eventually end up disposing them when the user closes the preview form.

Edited by: Jos Silva on May 21, 2009 5:36 PM

former_member183750
Active Contributor
0 Kudos

That is fine. It is up to you if you want to use the recommendation or not. I think testing the recommendation and seeing if it helps, would be the way to go.

If you do not agree, perhaps somebody else can jump in and suggest a better way to go.

Ludek

Former Member
0 Kudos

The problem is that you keep the CRViewer open while you are opening the others Documents.

For example (pseudo code):


while (i< 150)
{
     reportDoc = New ReportDocument()
      reportDoc.Load(reportPath)
      crViewer = New CRViewer()
      crViewer.ReportSource = reportDoc
}

This will end up in the specified error.

I could understand it if the machine was running out of memory, but it isn't.

former_member183750
Active Contributor
0 Kudos

That is fine, but somewhere, somehow, you will need to dispose of the report objects. I believe if you open a number of, say dataset objects, or datagrid objects, over and over without disposing of them, you will eventually get essentially the same behavior(?).

Ludek

Former Member
0 Kudos

Hi,

A simple way to reproduce this is to open and preview a blank report several times (100+). (you also have to increase the default print job limit)

former_member183750
Active Contributor
0 Kudos

Are you using .Close and .Dispose on your report objects once you are done with them?

Ludek