We are currently running Umbraco 7 and have noticed we keep getting an out of memory exception error in our Trace Logs, here's the error:
An unhandled exception occurred System.OutOfMemoryException: Out of memory. at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.DrawImage(Image image, Int32 x, I
An unhandled exception occurred
System.OutOfMemoryException: Out of memory.
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y)
at System.Drawing.Graphics.DrawImageUnscaled(Image image, Int32 x, Int32 y)
at ImageProcessor.Common.Extensions.ImageExtensions.Copy(Image source, AnimationProcessMode animationProcessMode, PixelFormat format, Boolean preserveExifData)
at ImageProcessor.ImageFactory.Load(Stream stream)
at ImageProcessor.Web.HttpModules.ImageProcessingModule.
Has anyone had this issue before and could point me in the direction of a possible solution?
Are you doing any custom manipulation of images on your site, I've seen that error before if loading an image into a memory stream to manipulate with System.Drawing and then the memory stream is closed before the image is saved... but that was like 12 years ago!
I would imagine you would be using ImageProcessor to do any manipulation of images...
I'd be tempted to see if you can pin down what requests are being made at the time of the trace log error, if there isn't any corresponding info in the logs as to what is happening at the time of the error, I'd cross-reference the IIS logs, at the time of the error - you might find it's an issue with a particular image, or you might find it's some kind of bot requesting an image with an invalid resize parameter...
If the error is other things than the memory stream closing before the image is saved. Then you basically needs more avaiable memory for you application.
In our own applications using Umbraco we use between 2 to 4 GB memory for each solution. Depending on alot of things, like traffic, custom modified code and image handling.
If your application runs on a 64 bit server. Then setting the application pool to 32-bit, will run the garbage collector more often and reduce memory usage.
If you allow editors to upload huge image files like 50 MB +. Then it can also cause this issue.
To add to the previous questions, this is not a memory leak, I've ran into it too. It's always either an image is too big for the server (yes, a client put an 65mb png at some point) or as other said you're doing something with it that exceeds the memory space.
Either way, it's most likely the Stream that's handling the image going 'I can't eat anymore, grandma'.
Out of Memory Exception - Umbraco 7
Hi All,
We are currently running Umbraco 7 and have noticed we keep getting an out of memory exception error in our Trace Logs, here's the error:
An unhandled exception occurred System.OutOfMemoryException: Out of memory. at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.DrawImage(Image image, Int32 x, I
An unhandled exception occurred System.OutOfMemoryException: Out of memory. at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y) at System.Drawing.Graphics.DrawImageUnscaled(Image image, Int32 x, Int32 y) at ImageProcessor.Common.Extensions.ImageExtensions.Copy(Image source, AnimationProcessMode animationProcessMode, PixelFormat format, Boolean preserveExifData) at ImageProcessor.ImageFactory.Load(Stream stream) at ImageProcessor.Web.HttpModules.ImageProcessingModule.
Has anyone had this issue before and could point me in the direction of a possible solution?
Thank you in advance Ben
Hi Ben
Are you doing any custom manipulation of images on your site, I've seen that error before if loading an image into a memory stream to manipulate with System.Drawing and then the memory stream is closed before the image is saved... but that was like 12 years ago!
I would imagine you would be using ImageProcessor to do any manipulation of images...
I'd be tempted to see if you can pin down what requests are being made at the time of the trace log error, if there isn't any corresponding info in the logs as to what is happening at the time of the error, I'd cross-reference the IIS logs, at the time of the error - you might find it's an issue with a particular image, or you might find it's some kind of bot requesting an image with an invalid resize parameter...
regards
marc
Hi Ben.
Marc beat me to an answer :)
If the error is other things than the memory stream closing before the image is saved. Then you basically needs more avaiable memory for you application.
In our own applications using Umbraco we use between 2 to 4 GB memory for each solution. Depending on alot of things, like traffic, custom modified code and image handling.
If your application runs on a 64 bit server. Then setting the application pool to 32-bit, will run the garbage collector more often and reduce memory usage.
If you allow editors to upload huge image files like 50 MB +. Then it can also cause this issue.
To add to the previous questions, this is not a memory leak, I've ran into it too. It's always either an image is too big for the server (yes, a client put an 65mb png at some point) or as other said you're doing something with it that exceeds the memory space.
Either way, it's most likely the Stream that's handling the image going 'I can't eat anymore, grandma'.
Thank you for your replies everyone, we are still investigating.
is working on a reply...