Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan Evans 629 posts 1016 karma points
    Apr 22, 2011 @ 03:45
    Dan Evans
    0

    Out of memory

    I'm getting an Out of memory error on a relatviely small image - 630KB

    http://perfectlyclear.dedicated.dev.plan9.co.uk/ImageGen.ashx?image=/umbraco/plugins/umbracoContour/files/1a51ffe5-7c6a-46fa-a0d8-2d366a8f8b05/me.jpg

    Using version 2.5.2.17053

    Any ideas?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 22, 2011 @ 10:50
    Jan Skovgaard
    0

    Hi Dan

    Can you tell us a bit about the server your Umbraco installation is hosted on? Is it only this image it's happening with or does it happen with other images created after this one as well?

    /Jan

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 25, 2011 @ 10:35
    Douglas Robar
    0

    Learn something new every day... the image you are using is JPG with a CMYK colorspace. Didn't know that was even possible in JPG (indeed, it might actually be a JPEG2000 format and I'll look more closely into that). That's the origin of the problem. I'll add that as a feature request in a future version. Apologies the error message wasn't clearer on that point, I'll update that too.

    cheers,
    doug.

     

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 25, 2011 @ 13:34
    Douglas Robar
    0

    Hmmm. Just ran some tests with your image... it works just fine here and I am no longer sure it is a cmyk issue. 

    Since I can't reproduce the problem, I wonder if you could post your imagegen.config file information, particularly for the classes? Perhaps there's a combination of features that is causing the problem.

    cheers,
    doug.

  • Dan Evans 629 posts 1016 karma points
    Apr 26, 2011 @ 11:07
    Dan Evans
    0

    Hi Doug

    I haven't changed the default settings in the config file.

    Dan

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 26, 2011 @ 17:25
    Douglas Robar
    0

    Hi, Dan,

    Any chance you're running on Win2008 R2 or Win7? There seems to be a .net issue when using cmyk jpegs on those platforms and I can reproduce the problem on Win7 but not on "lesser" versions such as XP, which renders the image perfectly.

    cheers,
    doug.

  • Dan Evans 629 posts 1016 karma points
    Apr 26, 2011 @ 17:31
    Dan Evans
    0

    Good detective work. Yes, running Win Web Server 2008 R2.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 26, 2011 @ 17:41
    Douglas Robar
    0

    Okay, then I know the origin of hte problem (it's a .net/windows bug) and I can reproduce it! :) 

    FWIW, it is related to cmyk jpegs, but not because of my code but because of the .net/windows bug. Looking for a solution now. Hope to have a fix for you to test soon. Probably Wednesday.

    cheers,
    doug.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 26, 2011 @ 18:15
    Douglas Robar
    1

    I believe I have a fix and will release it tomorrow as ImageGen 2.5.3. 

    @Dan, can you contact me through my website and let me know your email address so I can send it to you for testing on your site before making it a public release? http://www.percipientstudios.com/about/contact.aspx

    cheers,
    doug.

  • Dan Evans 629 posts 1016 karma points
    Apr 27, 2011 @ 11:38
    Dan Evans
    0

    Hi Doug

    Just checking you got my contact details?

    Thanks

    Dan

  • Dan Evans 629 posts 1016 karma points
    Apr 29, 2011 @ 09:00
    Dan Evans
    0

    Yes that fixed it!

  • Mikkel Johansen 116 posts 292 karma points
    Jun 30, 2011 @ 02:21
    Mikkel Johansen
    0

    Hi Doug,

    Is the 2.5.3 version released?

     

    Regards

    Mikkel

  • Phil Dye 149 posts 325 karma points
    Jul 20, 2011 @ 15:11
    Phil Dye
    0

    Doug, I have the same question - I'm pretty sure I'm seeing the same problem, having just moved a previously-ok site to a new Win2k8R2 server.

    Phil

  • Phil Dye 149 posts 325 karma points
    Jul 21, 2011 @ 11:55
    Phil Dye
    0

    For the record, 2.5.4 definately fixes this problem; I upgraded the affected site this morning, and all is good again. Thanks Doug!

     

  • skiltz 501 posts 701 karma points
    Jul 22, 2011 @ 03:12
    skiltz
    0

    Where to download from?

     

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jul 22, 2011 @ 09:01
    Douglas Robar
    0

    A beta of ImageGen 2.5.4 that patches the 'CMYK JPEG out of memory' problem is now available for download at http://our.umbraco.org/projects/website-utilities/imagegen

    cheers,
    doug. 

  • skiltz 501 posts 701 karma points
    Jul 22, 2011 @ 09:10
    skiltz
    0

    Thanks for this Doug.

    I've uploaded the new dll but I now get this error 'Requested image path is not allowed. (/Upload/bow/b9b1069b-507c-4a80-a544-93a012007c00.jpg)'

    url looks like:

    http://www.mysite.co.nz/umbraco/ImageGen.ashx?image=/Upload/bow/b9b1069b-507c-4a80-a544-93a012007c00.jpg&width=64&height=64&constrain=true&AllowUpSizing=false

     

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jul 22, 2011 @ 09:14
    Douglas Robar
    0

    @Skiltz - sorry, you're right. If you put the imagegen.ashx file in the root of the site (rather than in the old location of buried in the umbraco folder) it'll work. Having /imagegen.ashx is the new location and there's a bug in the beta patch that wrongly doesn't handle it being anywhere else. That'll be fixed for the final release.

    cheers,
    doug. 

  • Mentor Digital 19 posts 135 karma points
    Oct 05, 2011 @ 17:21
    Mentor Digital
    0

    Hi,

    I have the exact same issue which is causing very big problems.  Can someone supply me the fix or help?

     

    Cheers 

  • Mikkel Johansen 116 posts 292 karma points
    Oct 05, 2011 @ 18:55
    Mikkel Johansen
    0

    Hi Craig

    Go grab the beta-patch
    http://our.umbraco.org/projects/website-utilities/imagegen

    It worked for me.

     

    /Mikkel 

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 03, 2012 @ 13:09
    Jeroen Breuer
    0

    Just tried ImageGen.2.5.4.27302-beta-update.zip and ImageGen_2.5.7.zip, but I still get an out of memory exception on random small images. Running on Win7. Is there any way I can get more debug info about what could cause the exception?

    Jeroen

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 03, 2012 @ 13:18
    Jeroen Breuer
    0

    Just read this topic: http://our.umbraco.org/projects/website-utilities/imagegen/imagegen-bugs/29675-One-specific-image-wont-show-in-one-specific-widthq?p=0#comment110558

    It doesn't seem related, but after I add format=jpg to my images (they were jpeg) I don't get the out of memory exception anymore.

    Jeroen

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 03, 2012 @ 14:18
    Jeroen Breuer
    0

    Hmm looks like format=jpg only works when the images have a relative path. If the image has a full path I still get out of memory exceptions.

    Jeroen

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 03, 2012 @ 14:47
    Jeroen Breuer
    0

    Hmm still getting out of memory exceptions randomly only not as much as before :(.

    Jeroen

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 03, 2012 @ 15:04
    Douglas Robar
    0

    @Jeroen - what happens if you use a newer version of ImageGen, say 2.5.7?

    If you still get problems, can you let me know a URL where I can see the problem on the site? Email me if it's not a public url. 

    cheers,
    doug. 

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 03, 2012 @ 15:10
    Jeroen Breuer
    0

    Hi Doug,

    I already tried 2.5.7, but that gives the same problems. Currently the website only runs local on my pc so I can't show it yet. Do you perhaps have a version which can show more info like a stack trace instead of only "out of memory"? Thanks.

    Jeroen

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 03, 2012 @ 16:19
    Jeroen Breuer
    0

    I'm using NopCommerce 1.90 and there images which are uploaded as .jpg are stored as .jpeg on the file system. Could that cause any problems?

    Jeroen

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 04, 2012 @ 06:55
    Jeroen Breuer
    0

    Is there any way I can get more info about this problem? I'm running on win7 and the website I'm working on can't go live until this is fixed.

    Jeroen

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 04, 2012 @ 10:09
    Douglas Robar
    0

    The error message is simply being passed along by ImageGen from .net / the OS. It really means what it says. The question is, why? Especially with small images. And more interestingly, with random images.

    You'll have to tell me more about what's going on. If there were an image or two that consistently gave a problem that would be great, but it doesn't sound like that's the case so reproducing the issue may be a challenge.

    You can help with some tests. First, use the &nocache=true flag for a while. That will force ImageGen to ignore any already-cached version and always re-create the image you request. It'll make a performance hit but will have two side effects of interest. First, it should make any memory condition more evident since ImageGen will be using cpu/memory for every request to resize the original images rather than just serving from already-cached versions. So hopefully the problem will happen more often. Second, there won't be a chance of somehow caching a bad image and then serving it again on repeated requests. In other words, we will see exactly what's going on with each image on every request.

    Other things to consider... while your computer may have lots of memory, is your site's application pool limited in memory? Also, are the images you are working with local or remote? 

    cheers,
    doug. 

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 11, 2012 @ 14:51
    Jeroen Breuer
    0

    Hello,

    I've had a couple of emails with Doug and we still don't know how to fix the problem. I created a new website and added ImageGen and the images in it and I can still reproduce the problem in there. You can download it here. Open the solution, run default.aspx and refresh a couple of times to see the error. Doug already did some tests. Here is a part of the email: 

    "I was just able to see the error a few times using your project (thank you!!). Unfortunately, as soon as I fire up the debugger... no more problem.  I hit ctrl-R at least a couple hundred times and no exception of any kind was triggered anywhere. After 15 minutes I gave up with ctrl-R.
    I did manage to use a debug build of the production dll and got at least a hint of where the issue might be... with .net most likely. From some google searching the 'out of memory' error might mean any number of things, including 'out of file handles'. I do of course dispose of everything immediately but still I wonder because of the lazy garbage collection in .net. And that it only appears when you have a lot of images in a gallery.
    But then again, I have a 'lotsa' page I use for debugging with more than 600 images on a page, all resizing 1280px images to 80px and putting text on them as well. Massive burden on the cpu. No problems."

    Here is my reaction:

    "The only I can think of is that there is something special with these images which ImageGen doesn't like. I just don't know what. Like I said before the images are generated by NopCommerce. They are uploaded as .jpg files, but NopCommerce first saves them as blob files in the database and later writes them to a folder on the harddisk. On the harddisk the image extensions are .jpeg instead of .jpg so my guess is that something happens to those images which causes the exception."

    Does anyone have an idea what could be the problem and how to fix it? Thanks!

    Jeroen

  • Grant Thomas 291 posts 324 karma points
    Apr 11, 2012 @ 15:04
    Grant Thomas
    0

    Is the ImageGen library open source? I've actually written a couple of libraries for this very purpose and have experience in imaging, I could possibly have something to contribute - obviously it will take a bit of digging, as you guys have discovered.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 11, 2012 @ 15:06
    Jeroen Breuer
    0

    ImageGen is not open source. If you want to contribute something you'll have to ask Doug.

    Jeroen

  • Grant Thomas 291 posts 324 karma points
    Apr 11, 2012 @ 15:10
    Grant Thomas
    0

    Well, my previous post should let him know where I stand. Feel free to catch up with me, Doug.

  • Lennart Stoop 304 posts 842 karma points
    Apr 11, 2012 @ 16:00
    Lennart Stoop
    0

    I would suspect the image's format to be causing this.. There's so many ways to "corrupt" images, especially those that are generated from a DB.

    Not sure if its possible, but you could try and replace the images with some copies that haven't been generated by nopCommerce and see if the problem still occurs. 

    To reproduce the error you can just write a quick script that fires requests to the default.aspx.

     

    Of course, that would only verify if the images are somehow corrupt, not really a solution tho.

  • Kris Dyson 54 posts 79 karma points
    Jul 20, 2012 @ 15:09
    Kris Dyson
    0

    This is most likely a threading issue within ImageGen.  I have just emailed Doug with the following:-

    I'm using ImageGen basic for a client project but I'm getting out of memory errors.  This happens across all types of jpg images.

    I find that it's reproducible when I use Fiddler2 and request the same image multiple times simultaneously, which would indicate to me it's some kind of threading issue (e.g. accessing the File with a Read lock which may prevent another thread from Reading the file).

    I just tested accessing the URL sequentially 9 times in a row and no errors occurred, however, if I select all those requests in Fiddler2 and hit Replay > Reissue Requests, then the error occurs 2 out of the 9 times.

     

    The query string is:
    ?image=/media/profiles/1.jpg&AltImage=/images/profile.png&constrain=true&width=160&nocache=true

    The error response is:
    HTTP/1.1 200 OK
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Vary: Accept-Encoding
    Server: Microsoft-IIS/7.5
    Date: Fri, 20 Jul 2012 12:54:21 GMT
    Content-Length: 14

    Out of memory.

    ------------------------------------------

    Maybe if other people could also test their installations with Fiddler (sequential access vs parallel requests) then we can get to the bottom of this.

    Many thanks

    Kris

Please Sign in or register to post replies

Write your reply to:

Draft