Page 1 of 1

Exception of type 'System.OutOfMemoryException' was thrown.

Posted: Wed Mar 04, 2009 1:22 am
by silade
I click the save button in the stiWebViewer afert prevew.But My application will give the error "Exception of type 'System.OutOfMemoryException' was thrown".
I think the cause if the records are too much.But why? How can I stop this condition?Thank you.

Exception of type 'System.OutOfMemoryException' was thrown.

Posted: Wed Mar 04, 2009 2:43 am
by Jan
Hello,

How many pages contain your report?

Thank you.

Exception of type 'System.OutOfMemoryException' was thrown.

Posted: Wed Mar 04, 2009 7:11 pm
by silade
About 300 pages.I use barcode Control.

Exception of type 'System.OutOfMemoryException' was thrown.

Posted: Thu Mar 05, 2009 4:39 am
by silade
Jan wrote:Hello,

How many pages contain your report?

Thank you.
What is the reason?Did you have solution?

Exception of type 'System.OutOfMemoryException' was thrown.

Posted: Thu Mar 05, 2009 10:12 am
by Edward
Hi,

The reason was very simple. Each barcode is represented as a picture. It consumes some resources. And asp process just was out of the required size of the memory.

Thank you.

Exception of type 'System.OutOfMemoryException' was thrown.

Posted: Thu Mar 05, 2009 6:47 pm
by silade
Edward wrote:Hi,

The reason was very simple. Each barcode is represented as a picture. It consumes some resources. And asp process just was out of the required size of the memory.

Thank you.

But how many pages your report can load maximumly if I use barcode Control?The size of my memeory is 2GB.Are you sure your report have not Memory Leak?
I am afraid of this.Thank you.

Exception of type 'System.OutOfMemoryException' was thrown.

Posted: Fri Mar 06, 2009 1:11 pm
by Jan
Hello,
But how many pages your report can load maximumly if I use barcode Control?
This is not depend from report engine. It depend from size and count of barcode components. For example if your report have 300 pages, on each page you have 10 barcode and image of one barcode have size around 1 mb, then you need 300x10x1.000.000 = 3 gb of memory. Also you need take in attention that asp.net process usually can take only around 500 mb. It depend from system settings. What you can do with this problem?[/quote]

1. Try to change ImageFormat property of StiWebViewer to Jpeg;
2. Do not render 300 pages on one iteration. Create 6 reports per 50 pages;
3. Do not use StiWebViewer. Output report results directly to pdf with help of following code: StiReportResponse.ResponseAsPdf(this, report);

Also please provide full error stack for this problem.
The size of my memeory is 2GB.Are you sure your report have not Memory Leak?
This is not possible for one report. This critical for 1000 reports. In this case you need use some special methodic to avoid compilation process.

Thank you.