Exception of type 'System.OutOfMemoryException' was thrown.

Stimulsoft Reports.NET discussion
Post Reply
silade
Posts: 16
Joined: Thu Feb 05, 2009 2:03 am

Exception of type 'System.OutOfMemoryException' was thrown.

Post 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.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Exception of type 'System.OutOfMemoryException' was thrown.

Post by Jan »

Hello,

How many pages contain your report?

Thank you.
silade
Posts: 16
Joined: Thu Feb 05, 2009 2:03 am

Exception of type 'System.OutOfMemoryException' was thrown.

Post by silade »

About 300 pages.I use barcode Control.
silade
Posts: 16
Joined: Thu Feb 05, 2009 2:03 am

Exception of type 'System.OutOfMemoryException' was thrown.

Post by silade »

Jan wrote:Hello,

How many pages contain your report?

Thank you.
What is the reason?Did you have solution?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Exception of type 'System.OutOfMemoryException' was thrown.

Post 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.
silade
Posts: 16
Joined: Thu Feb 05, 2009 2:03 am

Exception of type 'System.OutOfMemoryException' was thrown.

Post 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.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Exception of type 'System.OutOfMemoryException' was thrown.

Post 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.
Post Reply