Hello,
sometimes we get an OutOfMemoryException, if we print a report, open in the preview, or export as PDF.
The error only occurs if the report contains a large image (A4 watermark in overlay band).
But only in one of 50 calls.
The computer's memory is not full and the application is around 200 MB.
Does anyone have a good idea?
I tested the follow options:
- Smoothing on / off
- Report Cache Mode on / off / auto
- Insert Image in report and insert image URL in report
Here the detail exception:
System.OutOfMemoryException: Nicht genügend Arbeitsspeicher.
bei System.Drawing.Graphics.CheckErrorStatus(Int32 status)
bei System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height)
bei System.Drawing.Bitmap..ctor(Image original, Int32 width, Int32 height)
bei System.Drawing.Bitmap..ctor(Image original)
bei Stimulsoft.Report.StiFileImageCache.LoadImage(String path)
bei Stimulsoft.Report.Components.StiView.get_ImageToDraw()
bei Stimulsoft.Report.Painters.StiImageGdiPainter.Paint(StiComponent component, StiPaintEventArgs e)
bei Stimulsoft.Report.Components.StiComponent.Paint(StiPaintEventArgs e)
bei Stimulsoft.Report.Painters.StiContainerGdiPainter.PaintComponents(StiContainer container, StiPaintEventArgs e)
bei Stimulsoft.Report.Painters.StiPageGdiPainter.Paint(StiComponent comp, StiPaintEventArgs e)
bei Stimulsoft.Report.Components.StiComponent.Paint(StiPaintEventArgs e)
bei Stimulsoft.Report.Components.StiPage.Paint(Graphics g)
bei Stimulsoft.Report.Viewer.StiThumbsControl.OnPaint(PaintEventArgs e)
bei System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
bei System.Windows.Forms.Control.WmPaint(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
System.OutOfMemoryException
-
- Posts: 31
- Joined: Thu Jul 16, 2015 12:22 pm
Re: System.OutOfMemoryException
Hello.
If there are large images, you could get such error because of the fragmentation of the memory.
It's necessary to get the one large block of the memory for a large image. If there is no such block you could get such error.
Even of the free memory is available.
In 64 bit application you should not get such exception or it will be much more rarely.
Thank you.
If there are large images, you could get such error because of the fragmentation of the memory.
It's necessary to get the one large block of the memory for a large image. If there is no such block you could get such error.
Even of the free memory is available.
In 64 bit application you should not get such exception or it will be much more rarely.
Thank you.
-
- Posts: 31
- Joined: Thu Jul 16, 2015 12:22 pm
Re: System.OutOfMemoryException
We can not be up to 64 bit.
The watermark is a png (115 kb).
Are there any other workarounds? Perhaps by changing the file format?
The watermark is a png (115 kb).
Are there any other workarounds? Perhaps by changing the file format?
Re: System.OutOfMemoryException
Hello.
At rendering time the image is stored in memory unpacked as bitmap.
So it could take very much memory and changing of the file format will not solve the issue.
Thank you.
At rendering time the image is stored in memory unpacked as bitmap.
So it could take very much memory and changing of the file format will not solve the issue.
Thank you.
Re: System.OutOfMemoryException
Hello Stimulsoft,
or you implements support for vector graphics, your image control can load wmf/emf files, but if you export to pfd, you render as bmp, that the reason for memory consumtion.
Greetings
or you implements support for vector graphics, your image control can load wmf/emf files, but if you export to pfd, you render as bmp, that the reason for memory consumtion.
Greetings
Re: System.OutOfMemoryException
Hello,
Can you please send us a sample report template with data, which reproduces the issue, for analysis?
Thank you.
Can you please send us a sample report template with data, which reproduces the issue, for analysis?
Thank you.