Skip to main content
Known Participant
February 3, 2011
Question

Poor RAM management in Photoshop CS4 - need help!

  • February 3, 2011
  • 8 replies
  • 28987 views

I have done numerous hours of research over the years only to give up and come back to this subject later on. I will try again!

I must ask: is there ANY way to get Photoshop CS4 to automatically flush used RAM after closing image files? I'm tired and annoyed of CS4 eating more and more RAM without freeing anything after an image has been closed. An image shouldn't still eat up memory when it isn't even open anymore. It seems to be terrible RAM management of the program itself and how Adobe has forgotten to write that little snippit of code to clear the RAM after an image has been closed.

I know this is not because of:

Cache levels

Setting too large of a saved history state; purging history cache or any kind of cache still never frees RAM

A lack of updates; I have been up to date with CS4 very punctually as they were released

The computer I am on; this poor RAM management has been around since CS2 and it's the same on the last 4 computers I have used

Does CS5 still do this too?

    This topic has been closed for replies.

    8 replies

    Known Participant
    February 9, 2011

    Grr. Of course. After enabling GPU enhancement, my tool cursor disappears if I set it to larger than 200 pixels while in full screen and toggled the screen mode to show only the picture. It shows my tools in any other display setting though.

    What's up with that?

    Chris Cox
    Legend
    February 9, 2011

    The large cursor disappearing sounds like an old (2 years now?) NVidia driver bug that they fixed.

    Participant
    February 6, 2011

    I have been having this problem on my 32 bit machine, but when I run it on my 64 bit its fine.

    Noel Carboni
    Legend
    February 5, 2011

    Back to the original subject:  Multitasking 101

    A scenario in which the "choose how much to allocate ahead of time" strategy can be seen to fall on its face in a mutitasking system:

    1.  Let's say you have 8 GB of RAM.

    2.  Go into Edit - Preferences - Performance and set Photoshop's RAM for, say 7 GB.

    3.  Close Photoshop.

    4.  Run another big progam you don't run very often, e.g., VMware, that preallocates 4 GB.

    5.  Start Photoshop again.

    Now Photoshop doesn't use a percentage of the current available RAM, but rather (with sufficient activity) it tries to use the saved AMOUNT of 7 GB, but of course there's nowhere near that much available at the moment because it's being used by another app.

    This isn't theoretical; it's easy to demonstrate.  All it takes is two apps that preallocate memory and think they're the centers of the computing universe.  You may say that Photoshop tries to play nice when it sees excessive swapping, but systems actually slow to a crawl under this condition.  Saying it and doing it are two different things.

    The only workable solution is to put in a LOT of RAM and set Photoshop's RAM allocation to be whatever the SMALLEST amount of memory that will be available at any time you might want to run it, and install sufficient RAM to allow everything you could possibly run simultaneously to coexist.

    This completely defeats the purpose of having dynamically allocated resources on a general purpose computer, don't you think?

    Modern systems support more tasks and do better multitasking than ever before, and quite stably.  We've already been talking about the reasons why (e.g., more cores).  Photoshop's memory management design might have been more proper for the ancient Macintosh on which it was invented (and which only did cooperative tasking), but the "when we try to use the OS it blows" and "professionals run only Photoshop" arguments just don't hold water.

    Chris, I do hope you'll consider making Photoshop act a little more grown up in the playground in the next version.  Don't forget what the 'S' in CS6 is supposed to stand for.

    -Noel

    Chris Cox
    Legend
    February 5, 2011

    Now Photoshop doesn't use a percentage of the current available RAM, but rather (with sufficient activity) it tries to use the saved AMOUNT of 7 GB, but of course there's nowhere near that much available at the moment because it's being used by another app.

    You're ignoring virtual memory and OS paging.

    But having multiple apps with high RAM usage is exactly why Photoshop offers the user a choice on RAM usage.  If two RAM hungry apps tried to be completely dynamic about their usage, things would be much, much worse (ie: they'd fight over the RAM and both would lose or page heavily).  That's usually taught as a lesson in operation systems classes.

    No, Photoshop's memory management is very much needed for current OSes.

    Photoshop is already designed to work well in an environment with multiple applications running, even those that might be actively using a lot of RAM.  We've been working with the OS vendors to improve things all along, researching and testing other methods, and tweaking our algorithms to work well with current systems.

    Just because you don't understand the details, doesn't make it wrong.

    Participant
    February 5, 2011

    Reading through the reply's - not sure the average user could follow (Im a photographer and pretty low on software architecture side of the index).  However, here are links to some basic information - PS performance.  You may have already have found this, however, it might be useful to others.

    http://www.thelightsright.com/OptimizePerformanceCS5-Part1

    http://www.thelightsright.com/OptimizePerformanceCS5-Part2

    Participant
    February 4, 2011

    I have to admit, PS (CS5, Windows XP) does slow down after I process many images.  Closing and restarting PS helps but rebooting the OS is better.

    In preferences, what is the best percentage setting for memory usage?  I have read various post on this.

    Interesting comment from Chris (thanks btw, for your feedback) - logging on as a different user.  Is this a good alternative that can reduce other, unnecessary programs from running in the background?

    Thanks ...

    Participating Frequently
    February 4, 2011

    In catching up in this thread, it seems there were two main issues.

    1)      You overallocated your PS RAM and needed to be scaled back.

    2)      Your historically conditioned to believe software apps should swap data a standard way. The way your using the system is probably not the most effective processing for your workflow. It probably is though for a high % of other users that use the application. You just have to live with it… or jump ship.

    >>> This is why I want every MB I can scrape out of my machine. Anyone who thinks paging is a good thing for non-emergency operations can scratchdisk my arse haha (joke)

                  

    You don’t have enough experience with these topics. This is actually a true statement. Most companies with systems large and small have to think about what it costs to process specific jobs. If one in a thousand jobs swap, a decision must be made to know how much it would cost to retrofit a very expensive environment to keep that one job swap from occurring. Most times it is better to let the swap happen for this non-mission critical item than pay $50,000 to upgrade all systems.

    >>> There's no excuse for a crappy 'advanced memory algorhithms not taught in universities!"

    Your po-pooing stuff you don’t know much about. Your blaming the world for your self inflicted woes. Look from within grasshopper.

    Known Participant
    February 4, 2011

    Your historically conditioned to believe software apps should swap data a standard way. The way your using the system is probably not the most effective processing for your workflow.

    -  I have hundreds of TIFFS that take 60-120MB each in processing, and 8gb  of RAM. The more total RAM actually usable that I can use the better.  How the heck can using less of what is actually available RAM enhance my  workflow? Standard are standards for a reason. The ink industry for  printing is non-standardized and people waste $3-5 billion+ a year only  increasing on unused ink that is still remaining in their cartridges, because there is no standard way of manufacturing ink, filling cartridges, or monitoring how much ink is actually left in a cartridge. I'd love for more standards in more markets. Unless natively stable, all other programs on my computer work flawlessly with said demonized traditional methods and standards, even in high bandwidth applications a hell of a lot more intensive than  Photoshop CS4 will EVER be. Currently people keep disregarding the fact that in my situation CS DOESNT FREE THE RAM.  CS4 is balloon. Balloon inflate. Never deflate even when emptied. Overflow into other rooms of critical OS space where balloon shouldn't be when it fill the room full. How many analogies must I give? Must I use sign language? Binary?

    You don’t have enough experience with these topics. This is actually a
    true statement. Most companies with systems large and small have to
    think about what it costs to process specific jobs. If one in a thousand
    jobs swap, a decision must be made to know how much it would cost to
    retrofit a very expensive environment to keep that one job swap from
    occurring. Most times it is better to let the swap happen for this
    non-mission critical item than pay $50,000 to upgrade all systems.

    I said NON EMERGENCY SITUATIONS.  Emergencies are once in a while. You're repeating what I said like a parrot, but in different longer sentences with more words telling me I don't get what I'm talkinga bout. You're missing the full picture of what I am actually saying. That 1 in 1000 overflow would be exactly true in my situation with 7GB used, but it's not. Why not? Because the CS4 balloon will not deflate itself or reuse the empty space inside the balloon when it's needed, and the OS isn't given back any of the empty space to work with to know it doesn't need to page anything. In turn CS4 is going to try and scratch too when the OS is telling it that is has no more RAM left when indeed it does, but its hiding it in its own reserve balloon from itself. If a company needed just 700MB more room and either they spend $50k to upgrade to that, or get CS4 to release some space once in awhile, they'd sure as hell bother Adobe or write their own mod to force CS4 to release unused allocated RAM to get it.

    Self inflicted only because I want to push the limit of what is actually usable on my machine, not some 'safe zone' with high tolerance. My system is tuned for a fine line of performance and I know what it can hande. I know what it uses and it does not spike usage for random OS operations. It can handle 7GB to 7.2GB of RAM of freely used RAM to one active program if it needs that big of a workspace to work. If CS4 isn't going to reuse the hollow areas in that balloon, then that's not my fault. My OS can handle the fine tuning, and CS4 is what cannot, obviously, since it can see that much RAM but not use the last %10 correctly.

    Chris Cox
    Legend
    February 4, 2011
    Hum...as far as I can tell, you've never actually bothered to mention what system nor OS you are using nor really basic troubleshooting like what % of ram you are allowing Photoshop to use.

    Good Lord you're thick. If you were actually paying attention and wanted to help out instead of trying to get attention yourself, you'd have all the system info you need. Granted I did not say my OS, I've said every other detail about my RAM configurations. I was working with Chris but no one sees what is happening on my computer no matter how many analogies I give.

    I'm not going to let you be a lazy bum and ignore the whole conversation when I've conveyed plenty of information to Chris throughout.

    Now I've shown that Photoshop is reusing allocated memory.

    Like hell you have! I kept track of what was going on as I experienced it and you still don't even acknowledge that. How many times do I have to tell you ITS NOT REDUCING THE AMOUNT OF RAM THAT IT IS USING WHEN MUCH LESS IMAGE DATA IS OPEN THAN WHAT PHOTOSHOP IS TAKING FROM THE WINDOWS OS.

    And that includes a machine that locks up because of a high memory limit set in one application?

    Yes, in Photoshop CS4 and CS4 ALONE. You take so much out of context it gets annoying. Tunnel vision to prove your own opinions blinded by your experience with PS, even though I clearly have the situation happen to me in front of my face after I explained it as it was happening, which no one gave a single neuron to try and actually process what I said because you don't believe me and you don't want to believe me because its not in your superprofessional realm of thinking.

    If it was as simple of a problem as to what OS I was using or how big my page file is, I wouldn't need to ask the highest level of tech support for answers to such a base level problem.

    I know setting PS to 7.2 GB locks it up after doing enough processing and compiling, but it wouldn't if CS would free the damn RAM for Windows that its not even using after its done with it. It stays holding 7.2GB no matter how many images I close and leaves Windows presssed against the wall.

    And you're ignoring the fact that the system should keep running even with 200% of RAM allocated by applications, thanks to virtual memory and the pagefile.  It might slow down if more than 95% of the RAM is active, but it shouldn't stop.

    And you're ignoring the fact that after I close 4GB of image data that if only 3gb of image data is open it shouldnt be slowing down at all or using 7.2 GB still.


    ITS NOT REDUCING THE AMOUNT OF RAM THAT IT IS USING WHEN MUCH LESS IMAGE DATA IS OPEN THAN WHAT PHOTOSHOP IS TAKING FROM THE WINDOWS OS.

    Yes, we know - and I've already explained why that is perfectly normal, expected, and why it won't cause problems:  because Photoshop is reusing the memory, and will free memory when the OS needs it.

    And you're ignoring the fact that after I close 4GB of image data that if only 3gb of image data is open it shouldnt be slowing down at all or using 7.2 GB still.

    Correct on the shouldn't be slowing down part - which is why we are trying to help you figure out what is wrong with your system.

    But Photoshop should still be using all the memory it has allocated (up to the limit you set in preferences), until that memory is needed by a plugin or the OS.

    You need to be looking at your system and figuring out why normal to moderately heavy operation is causing it to lockup.

    Even if Photoshop has 7.5 GB allocated, and is only using 3GB, the OS is free to page out the idle memory (even image data you aren't currently using). Photoshop also will page the idle memory and image memory out to scratch so it'll free up faster if a user operation or the OS needs it.

    And even if all the RAM is allocated, the OS should not lockup due to simple paging.

    I clearly have the situation happen to me in front of my face after I explained it

    No, you jumped to several conclusions about your situation, which have already been shown to be false.  Most of that was based on a lack of knowledge about memory management and how operating systems handle memory -- and we've tried to fix some of that lack of knowledge by explaining how things actually work.  Continuing to repeat that black is white, will not make it so.

    Your valid observations are: 

    * Photoshop doesn't reduce memory usage unless it has to (true, by design)

    * That your system was running slowly when most of the RAM was in use (yes, that is likely)

    * That your system locked up while paging heavily when most of the RAM was in use (ok, not normal, but we don't know the cause)

    Now, we can work with you to solve that last mystery, but you have to work with us.

    Shouting and repeating things that you know not to be true isn't going to solve that.

    Participating Frequently
    February 3, 2011

    As somebody who has been involved with performance analysis and tuning of the largest business application systems in the world I was interested in seeing Chris’s description of the memory management philosophies as implemented in Adobes CS* products.

    Chris has outlined management strategies that are consistent with SAP’s high volume business processing platforms. The old school thinking of allocate and de-allocating memory has been outdated for many years. SAP abandoned these old school techniques close to 20 years ago with the advent of their R/3 product. They were inspired to do this to help minimize support costs which stabilizes the processing engine, which in turn keeps the customers happier and good word of mouth in the end helps them to sell more software. Everyone wins…

    Smaller scale users usually never have to confront these high resource intensive systems/designs, but here is one such case where the education process does needs attention to take these users into the 21 century of high quality software design.

    Chris’s finger pointing to other areas possibly causing issues definitely have merit. However, even as SAP has learned, they do uncover glitches in their products now and then. In this case, a different type of support is needed to pinpoint and resolve the issue and I really doubt an internet chat form like this is the most effective way to tackle things. I guess we will see soon enough.

    Hudechrome
    Known Participant
    February 3, 2011

    An interesting discussion about memory management. I would like to ask i-Iliz if he/she has any suggestions for small users in troubleshooting/tuning our systems should we suspect memory problems of the nature described here. As Noel mentioned, there was problems in the past, resolved by purging or exiting and reopening the program that is no longer a problem today at least on Win7 64. Yet things apparently are not perfect.

    Participating Frequently
    February 4, 2011

    Hudechrome wrote:

    An interesting discussion about memory management. I would like to ask i-Iliz if he/she has any suggestions for small users in troubleshooting/tuning our systems should we suspect memory problems of the nature described here. As Noel mentioned, there was problems in the past, resolved by purging or exiting and reopening the program that is no longer a problem today at least on Win7 64. Yet things apparently are not perfect.

    Well I cant offer much in terms of words of wisdom as I know nothing about the processing architecture of the CS* software and how it interplays with the OS.

    If it were me trying to better understand my environment though, the first thing I would do is boot the computer into Safe Mode and do my testing from there. If I remember correctly, Safe Mode only starts the vital portions of the OS thus eliminating other elements, especially 3rd party software that might be affecting my tests or results. If the stuttering stopped in this environment I would know some extraneous software would most likely be helping to cause the issues.

    Chris Cox
    Legend
    February 3, 2011

    I must ask: is there ANY way to get Photoshop CS4 to automatically flush used RAM after closing image files?

    No, because it shouldn't. This is very good memory management - otherwise Photoshop would be significantly slower.  Unfortunately this is more advanced than the techniques typically taught in universities.

    Photoshop is not leaking RAM, and reuses the RAM it has allocated.

    Unused memory will be paged out, and if the OS really needs more RAM available Photoshop will free up some of it's RAM.

    Photoshop's RAM usage should have little to no impact on other applications.

    So, why do you think a non-problem needs to be "fixed"?

    Known Participant
    February 3, 2011

    Oh great now I'm going to get a B.S. response like that as if I know nothing, and from Adobe. You're getting needlessly defensive since apparently you're answering questions I haven't even asked.

    In response to your statements:

    1. It shouldn't clear RAM its not using anymore? What? You clean your garage workbench after a project so you can work on the next project right? I hope. If you don't you'll never have the space for your next project. RAM runs at gigabytes per SECOND and couldn't possibly slow anything down by changing allocation. Photoshop is leaving the workbench full after closing images, and remains with next to no space left to work after its built up to %100 usage.

    2. I said nothing about Photoshop leaking RAM. You're right. It doesn't leak.

    3. Photoshop does NOT reuse the ram from the space it used after closing an image. If it did I wouldn't have any problem here. Once it hits %100 usage and starts grinding at my page file, I can close all the images open but Photostop still remains to use %100 of all available RAM. It also churns at a snails pace with any simple operation like cropping after that since it never frees or reuses any of the RAM until the whole program is closed and restarted.

    3. I am not talking about outside application performance, I am talking only about Photoshop and the way it operates within itself. You're right, it doesn't affect outside performance since the OS is left with enough to perform outside of CS4. If it affected programs outside CS4 my system would have locked up or become painfully slow every time it hit %100

    4. I think it needs to be fixed because its a problem. Its disrespectful talking to me talking to me as if I know nothing, and treating my request as if there isn't a problem to address. Most people can't expect performance from photoshop since they typically don't have a lot of RAM, but I do on a regular basis fill 7GB allocated to just CS4 with panoramas and mass raw processing. I should have plenty freed after closing a 3GB panorama so I can process my next image or batch of images, shouldn't I? Well, I don't. I don't always want to uload all my images at the same time, and I repeatedly run into the same roadblock. I know its not just my imagination, because I can recreate the problem at any time.

    Anyone else have any input on this that runs into this problem as well?

    Chris Cox
    Legend
    February 3, 2011

    Sorry, but that was the honest truth, and correct.

    Yes, allocations (and freeing) are still relatively slow on modern OSes.  We measure the impact every release to see if we need to change the memory allocation parameters (and sometimes we do).  But overall it is much, much faster to reuse memory than constantly free and reallocate.

    Yes, Photoshop does reuse the space freed after closing an image (or layer, or channel, or history state, etc.).  After you close an image, the memory that was used for that image goes into a pool of available memory that gets used for the next image (or preset, channel, history state, whatever).  That is central to our memory management.

    I'm not being disrespectful:  it is simply clear that I know more about the topic than you do, and have spent a great deal more time exploring the options and their impact than you have, so I am trying to inform you about the things you do not seem to know.  Is a professor disrespectful for teaching you a topic you don't understand?

    Again, the memory is always reused -- there is nothing slowing you down, no roadblocks, no need to exit and restart, and no problem except in your understanding of the situation.