Options

Slideshow memory leak?

raulpeschraulpesch Registered Users Posts: 64 Big grins
edited January 13, 2011 in SmugMug Support
I have the standard Smugmug Slideshow embedded on my homepage with the option to show the recent updates. I noticed however that the slideshow is causing a major memory leak in all browsers (IE, FF, Chrome). It appears that every picture shown in loaded into memory and not released after it is shows. This eventually eats up all the available memory and causes crashes and slowdowns. You can see this by starting the slideshow and looking at tge browser instance in the Task Manager.

Is there a workaround or fix for this?
«1

Comments

  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited November 3, 2010
    Link to your site please?
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited November 4, 2010
    I've had this happen for years. :cry I think it has more to do with the flash side of it than anything because on one of my systems, the flash plugin crashes first before taking down the browser. ne_nau.gif

    The only workaround I know of is to use some other slideshow system that uses javascript and the images versus flash. They got to be quite good until flash became all the rage. thumb.gif
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited November 4, 2010
    SamirD wrote: »
    I've had this happen for years. :cry I think it has more to do with the flash side of it than anything because on one of my systems, the flash plugin crashes first before taking down the browser. ne_nau.gif

    The only workaround I know of is to use some other slideshow system that uses javascript and the images versus flash. They got to be quite good until flash became all the rage. thumb.gif
    Can I have a link to your slideshow? ear.gif
  • Options
    SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited November 4, 2010
    Andy wrote: »
    Can I have a link to your slideshow? ear.gif
    When I review lots of videos (which the slideshow is basically just a flash video), I end up having to reboot several times a day due to the same slowness/crashing being described. We've actually talked about this before Andy. It's nothing new.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited November 4, 2010
    SamirD wrote: »
    When I review lots of videos (which the slideshow is basically just a flash video), I end up having to reboot several times a day due to the same slowness/crashing being described. We've actually talked about this before Andy. It's nothing new.

    Is this on your XP Wyse system?
  • Options
    SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited November 4, 2010
    Andy wrote: »
    Is this on your XP Wyse system?
    haha, no way! rolleyes1.gif It almost chokes on just the galleries.

    Reviewing videos is only on the athlon xpp 3gb system or the 866 xph with 512mb ram and gamer video card, depending on the location that I'm at. Obviously the athlon system can run for longer than the 866 before crashing, but it still does.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • Options
    raulpeschraulpesch Registered Users Posts: 64 Big grins
    edited November 7, 2010
    It happens on any side that has the Flash slideshow installed. To test, I eliminated all css and other customization code but the problem remains. It gets worse if you play the slideshow in a higher resolution (what I did).

    My site is peschfamily.com but I removed the flash slideshow since it caused total computer freezes when you left the homepage open for a while (on all PC's).

    Just take this site as another example: http://andydemo.smugmug.com/ and leave it open for an hour (in IE, iexplorer.exe memory allocation will increase with every photo displayed, in Firefox, the plugin-container process will increase. There does not seem to be any garbage collection or memory release. Instead it consumes more memory indefinitely and ultimately causes a total slowdown of your PC).
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited November 7, 2010
    raulpesch wrote: »
    It happens on any side that has the Flash slideshow installed. To test, I eliminated all css and other customization code but the problem remains. It gets worse if you play the slideshow in a higher resolution (what I did).

    My site is peschfamily.com but I removed the flash slideshow since it caused total computer freezes when you left the homepage open for a while (on all PC's).

    Just take this site as another example: http://andydemo.smugmug.com/ and leave it open for an hour (in IE, iexplorer.exe memory allocation will increase with every photo displayed, in Firefox, the plugin-container process will increase. There does not seem to be any garbage collection or memory release. Instead it consumes more memory indefinitely and ultimately causes a total slowdown of your PC).
    I can confirm that I see this same behavior in Firefox on Andy's demo site.

    This is absolutely terrible design of the flash slideshow. It appears to just keep chewing up more and more memory as long and their are new images to show. Bad, bad design. It should pick a reasonable number of images to cache and then beyond that release an image from memory each time a new one is loaded.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    raulpeschraulpesch Registered Users Posts: 64 Big grins
    edited November 9, 2010
    Is there any fix planned or workaround (eg. another slideshow plugin/javascript)?

    I would still like the slideshow but currently it is unworkable. Especially when your Smugmug site is also your homepage . If you forget to close it, it brings your computer to a total crawl (sometimes even totally crashing it forcing you to reboot).
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited November 9, 2010
    jfriend wrote: »
    I can confirm that I see this same behavior in Firefox on Andy's demo site.

    This is absolutely terrible design of the flash slideshow. It appears to just keep chewing up more and more memory as long and their are new images to show. Bad, bad design. It should pick a reasonable number of images to cache and then beyond that release an image from memory each time a new one is loaded.

    Can you use a memory tracker or something - Sam ran tests and saw memory usage, and release.
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited November 9, 2010
    IE Memory usage of slideshow on http://www.moonriverphotography.com

    8:18pm - 68,000
    8:20pm - 112,000
    8:28pm - 98,000
    8:33pm - 164,000
    8:56pm - 290,000
    9:19pm - 160,000
    9:29pm - 322,000
    9:32pm - 130,000

    Screenshots here:
    http://www.smugmug.com/gallery/14590499_GxfmK#1084909570_vBHax

    Am I missing something? This is Win7 64bit with IE8 running.
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited November 9, 2010
    Andy wrote: »
    Can you use a memory tracker or something - Sam ran tests and saw memory usage, and release.
    Here's what I saw for memory usage of plugin-container.exe (which is where Flash lives on Firefox/Windows). I loaded up my homepage (http://jfriend.smugmug.com) and set the browser window to a reasonable size (about 1400px wide x 1000px high). I then recorded memory usage using the Windows Task Manager and looking at home much memory it says that the plugin-container.exe process was using. Here's what I saw:

    0:00 26,444 kb
    2:00 69,256 kb
    4:00 126,932 kb
    6:00 176,288 kb
    8:00 219,180 kb
    10:00 267,604 kb
    12:00 317,440 kb
    14:00 368,908 kb
    16:00 408,264 kb
    ....
    28:00 697,200 kb
    30:00 746,180 kb
    32:00 102,820 kb

    So, from 0-32 mins, it steadily climbed and was using over 700MB. Then, at 32 mins, it dropped back down to 102MB and then started climbing again. I didn't let it run further to see what happens over a long period.

    A few findings:

    1) It uses a ridiculous amount of memory. Each new image in the slideshow (the largest of which is about 600kb) costs almost 5MB in Flash memory. Something really, really inefficient is happening such that the Flash memory usage goes up 8x as fast as the images it loads.

    2) It does eventually seem to release some memory (in my case, after 32 minutes). I didn't let it run for a really long time to see if it actually releases everything as it goes or if it slowly creeps up and eventually would take all physical RAM.

    3) Gobbling up 750MB of memory is kind of crazy. That's no big deal on my system because of how much physical RAM I have, but I can see how that could certainly cause problems on some systems. It doesn't need to be this bad. It really ought not use more than just a little more than 1x the images that it's caching for each new image that is loaded. And, it seems reasonable that there's no reason to keep old slideshow images in memory at all, beyond about the last couple images. If the slideshow repeats, they'll be fetched from browser disk cache anyway.

    4) I see no reason at all why the slideshow would continually take up more and more memory for 32 mins. Can it not be written so it uses some memory to load the first couple images and then doesn't use any more after that?
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited November 10, 2010
    jfriend wrote: »
    4) I see no reason at all why the slideshow would continually take up more and more memory for 32 mins. Can it not be written so it uses some memory to load the first couple images and then doesn't use any more after that?

    I don't know - but I can tell you that for years, we've gotten extremely few complaints along these lines, with millions and millions using and viewing slideshows. I have a lame 1Gb ram PC system and the slideshow doesn't seem to "clog" up the system at all. What happens if you leave other flash slideshows going? Or other flash apps running continuously?

    Of course we'll continue to look at this.
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited November 10, 2010
    jfriend wrote: »
    I didn't let it run for a really long time to see if it actually releases everything as it goes or if it slowly creeps up and eventually would take all physical RAM.


    I ran Firefox 3.6 over night, slideshow on http://moonriverphotography.com

    plucing-container.exe was at 40,000 on slide 1 when I started it last night, then 134,000 this morning, 11 hours later.
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited November 10, 2010
    Andy wrote: »
    I ran Firefox 3.6 over night, slideshow on http://moonriverphotography.com

    plucing-container.exe was at 40,000 on slide 1 when I started it last night, then 134,000 this morning, 11 hours later.
    I'll be blunt here. A slideshow that can require 750MB of memory is a disaster waiting to happen. It's wasting enormous amounts of memory. You may get away with it on most Windows systems, but it will have an impact on systems with 1 or 2GB of RAM and are running any other memory intensive apps and could cause them to crash. It absolutely won't work well on phones with Flash support. The whole notion that the slideshow uses 8x the memory of each new image it loads and only reclaims memory when it gets to 750MB of usage on some slideshows is just bad implementation somewhere. The whole thing should be able to do it's work in ~10MB + some overhead for the flash engine (~20MB) for a total of 30MB. If you preload ahead a few images, maybe 50MB, but certainly not 750MB.

    If you don't think this is a problem, please show some of your senior developers around the office these statistics and ask them if this is acceptable for a widely used Smugmug feature.

    P.S. I haven't specifically tested it, but the full-screen slideshow on a large monitor may be even more of a problem since it uses the largest images.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited November 10, 2010
    SamirD wrote: »
    I think it has more to do with the flash side of it than anything because on one of my systems, the flash plugin crashes first before taking down the browser. ne_nau.gif
    What do you think about this John? I've seen this same memory hog problem happen even when reviewing flash videos from SM. headscratch.gif
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited November 10, 2010
    SamirD wrote: »
    What do you think about this John? I've seen this same memory hog problem happen even when reviewing flash videos from SM. headscratch.gif
    I don't understand your question. I haven't done any tests on video.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited November 10, 2010
    jfriend wrote: »
    If you don't think this is a problem, please show some of your senior developers around the office these statistics and ask them if this is acceptable for a widely used Smugmug feature.

    I have, John:
    Andy wrote:
    Of course we'll continue to look at this.
  • Options
    SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited November 10, 2010
    jfriend wrote: »
    I don't understand your question. I haven't done any tests on video.
    Oh sorry, what I meant was since the slideshow is essentially creating a video on the fly and then playing it, have you seen the same issue with video? In my experience with video, I have. And to me that would mean it's more in the flash implementation since it affects both photos and video. ne_nau.gif
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited November 10, 2010
    SamirD wrote: »
    Oh sorry, what I meant was since the slideshow is essentially creating a video on the fly and then playing it, have you seen the same issue with video? In my experience with video, I have. And to me that would mean it's more in the flash implementation since it affects both photos and video. ne_nau.gif
    The slideshow is not creating a video and playing it. It is doing something much more efficient than that, just displaying static images and fading one in and the other out.

    FYI, I can play an HD video on YouTube (which uses flash for displaying video) and the Flash memory usage does not exceed 100MB - nowhere near the 750MB my slideshow took.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    WinsomeWorksWinsomeWorks Registered Users Posts: 1,935 Major grins
    edited November 10, 2010
    I wonder if this is why I've had such trouble with CS4 (Photoshop) stressing out saving changes to larger files. I'm sure I've left my Smug page open for awhile at times after looking for things here & going over to Photoshop w/o closing it. CS4 can really choke on that, sometimes to the point where I don't even know if it'll be able to save the file. That was even after an entire sweep of everything and new version installed & plenty of all kinds of memory (I thought). Dunno. Just wondering.
    Anna Lisa Yoder's Images - http://winsomeworks.com ... Handmade Photo Notecards: http://winsomeworks.etsy.com ... Framed/Matted work: http://anna-lisa-yoder.artistwebsites.com/galleries.html ... Scribbles: http://winsomeworks.blogspot.com
    DayBreak, my Folk Music Group (some free mp3s!) http://daybreakfolk.com
  • Options
    jchinjchin Registered Users Posts: 713 Major grins
    edited November 10, 2010
    I too have seen my FF use over 1GB of RAM just with my smugmug page loaded. It seems to also interfere with the Java uploader. If I close out of Firefox, wait a minute or so, then restart FF and load the pages, it works again. This is on a Windows 7 Pro 64-bit with 12GB of RAM (so RAM is not an issue). I have a funny feeling it is the way Firefox handles memory.
    Johnny J. Chin ~ J. Chin Photography
    FacebookFlickrSmugMug
    SmugMug referral coupon code: ix3uDyfBU6xXs
    (use this for a discount off your SmugMug subscription)
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited November 10, 2010
    jchin wrote: »
    I have a funny feeling it is the way Firefox handles memory.

    Firefox is TERRIBLE as a memory hog. Great browser, but it sucks up memory in a bad, bad way.
    http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=firefox+memory+hog

    I love Firefox and use it as my primary browser. But as someone who uses the internet all day every day for my work, I also restart Firefox several times a day. I just live with that..

    Why not go Chrome? There are still things I need as plugins in FF that I can't do as well in Chrome. Also FF's awesomebar is a huge time saver for me.
  • Options
    SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited November 11, 2010
    Back in the day when the full screen slideshow was non-flash powered, FF would crash whereas IE would not. FF definitely has a different way of handling memory.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • Options
    SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited November 11, 2010
    jfriend wrote: »
    The slideshow is not creating a video and playing it. It is doing something much more efficient than that, just displaying static images and fading one in and the other out.
    Forgive my ignorance, John. With flash being used primarily for video these days, I forgot its shockwave roots. I recall now there's all sorts of things that can be done in flash. thumb.gif I still wonder if it's a flash implementation? headscratch.gif I know photobucket uses flash for their slideshow. Is there a way you can compare theirs to SM?
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited November 11, 2010
    SamirD wrote: »
    Forgive my ignorance, John. With flash being used primarily for video these days, I forgot its shockwave roots. I recall now there's all sorts of things that can be done in flash. thumb.gif I still wonder if it's a flash implementation? headscratch.gif I know photobucket uses flash for their slideshow. Is there a way you can compare theirs to SM?
    Flash is a programming environment and you can do all sorts of things in it. I'm just saying that there is ZERO reason for a simple one at a time slideshow to be taking 750MB of memory. It should be holding no more than 4-5 slides in memory at a time which should be about 20MB.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited November 11, 2010
    I agree that there's definitely too much bloat with that type of memory usage, but if it's happening with other photo companies (like photobucket) that are using this type of slideshow, couldn't the problem be more related to the implementation within the flash kernal versus SM's particular slideshow implementation? headscratch.gif I'm all for getting this fixed, but if it's not SM's fault then there's no point in bringing it up to them to fix.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited November 11, 2010
    SamirD wrote: »
    I agree that there's definitely too much bloat with that type of memory usage, but if it's happening with other photo companies (like photobucket) that are using this type of slideshow, couldn't the problem be more related to the implementation within the flash kernal versus SM's particular slideshow implementation? headscratch.gif I'm all for getting this fixed, but if it's not SM's fault then there's no point in bringing it up to them to fix.
    Whether someone else's slideshow is a memory pig or not has nothing to do with this. It's Smugmug's responsibility - period. They decide what technology to use to deliver a slideshow and how to design and use it. It is possible to deliver a slideshow that doesn't use 750MB of memory. I don't feel the need to prove that by finding someone else's implementation that uses less.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited November 11, 2010
    jfriend wrote: »
    Whether someone else's slideshow is a memory pig or not has nothing to do with this. It's Smugmug's responsibility - period. They decide what technology to use to deliver a slideshow and how to design and use it. It is possible to deliver a slideshow that doesn't use 750MB of memory. I don't feel the need to prove that by finding someone else's implementation that uses less.
    I agree with your point that SM is responsible for their product--regardless of what someone else's product does.

    But that being said, if there's a common library that everyone doing flash slideshows is using that always is a memory hog, SM has to make a decision to use this readily available solution or code one up from scratch that may not necessarily be better. I don't know much about what's actually going on underneath the hood of the slideshow creation process and everything involved, but if it's something along these lines where it's not really in their control, what is SM to do?
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited November 12, 2010
    SamirD wrote: »
    I agree with your point that SM is responsible for their product--regardless of what someone else's product does.

    But that being said, if there's a common library that everyone doing flash slideshows is using that always is a memory hog, SM has to make a decision to use this readily available solution or code one up from scratch that may not necessarily be better. I don't know much about what's actually going on underneath the hood of the slideshow creation process and everything involved, but if it's something along these lines where it's not really in their control, what is SM to do?
    Here you go. Smugmug's own Flash slideshow on their own corporate homepage takes no more than 20MB, no matter how long you let it run: http://www.smugmug.com/photos/example-photo-sharing-sites/ and it seems to be showing a lot of different images.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
Sign In or Register to comment.