How Come Photoshop Does Not Release the Memory When You close the Images?

M
Posted By
maria
Oct 3, 2006
Views
468
Replies
4
Status
Closed
This has been puzzl;ing me for quite a long time.
I am watching the RAM usage on my computer, especially
when I load Photoshop. How come Photoshop does not release the RAM that the loaded images occupy as soon as they are closed? Isn’t the memory required for them in RAM?
The entire RAM memory is released only when the program itself is closed.
Thanks!

maria

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

J
Jim
Oct 3, 2006
"maria" wrote in message
This has been puzzl;ing me for quite a long time.
I am watching the RAM usage on my computer, especially
when I load Photoshop. How come Photoshop does not release the RAM that the loaded images occupy as soon as they are closed? Isn’t the memory required for them in RAM?
The entire RAM memory is released only when the program itself is closed.
Thanks!

maria
They don’t release memory until program end because releasing and then reallocating memory is time consuming with little benefit. As long as you keep the amount of RAM that PS can use at 50% or so, there should be little effect on the rest of the system.
Jim
MR
Mike Russell
Oct 3, 2006
"maria" wrote in message
This has been puzzl;ing me for quite a long time.
I am watching the RAM usage on my computer, especially
when I load Photoshop. How come Photoshop does not release the RAM that the loaded images occupy as soon as they are closed? Isn’t the memory required for them in RAM?

There are several reasons for this. Although not related to your question, the biggest one is the number of history states. Photoshop basically saves a complete copy of our image for each history state, and will fail with an out of memory condition if it is unable to do so. You can control this by reducing the number of history states in your prefs.

Another is that Photoshop’s tmp files are actually memory mapped and occupy address space, which is what you see when the Task Manager monitors RAM use. There is a similar thing going on when Photoshop bumps its pool of internal memory – releasing the memory flags it as free but the size of Photoshop’s memory pool remains at its maximum size. Closing an image frees the memory up internal to Photoshop, but the address space is not released. Oink oink, but the logic behind this is that you may be opening up a large image again, and this saves Photoshop the trouble of reallocating the scratch space.

Another reason for inflated memory size is the loading of DLL’s – these are chunks of code that get mapped to Photoshop’s address space, and they can hang around for some time, 10 minutes by default, after they are no longer used.

Finally, yes, the naked truth is that, for a variety of reasons shared by all mature products, Photoshop is still haunted by the ghosts of its old implementation. Before virtual memory, on the 68000 family of Macintosh, Photoshop had to simulate virtual memory management in software. Apple implemented virtual memory using the MMU available on the newer 68K processors, but it was dog slow, and most people kept it turned off. This went away in windows, and in OSX, but Photoshop still continues with it’s own idea of what virtual memory should be: slow and prone to run out. This is a constant headache to people like me who support plugins while the megapixel wars force memory requirements higher and higher.

So far, the best explanation I’ve found of how Photoshop handles its internal memory is in this Photoshopnews article:
< http://photoshopnews.com/2005/05/26/memory-allocation-and-us age-photoshop-cs2/>

For those of you with images that are much larger than 300 MB, Photoshop CS2 does allow you to add an extra gig of address space. Microsoft discusses the /3mb option here:
http://www.microsoft.com/whdc/system/platform/server/PAE/PAE mem.mspx

The entire RAM memory is released only when the program itself is closed.

LOL – be thankful for that. Other programs, such as Acrobat Reader, use resources continuously, and run in the background to minimize startup time. As time passes, Photoshop may do the same.

BTW – if you want to see Photoshop start up very quickly. One is to get hold of an older version – v2.5 starts in a matter of seconds on my Mac G4, not counting the time required to fire up classic.

Another is to download the Photoshop Speedup program from acropdf. This uses a rather Procrustean method of speeding up Photoshop, by chopping off fonts, presets, plugins, etc, but it is impressive to see just how fast Photoshop is capable of starting up. It should also help in situations where you are running out of memory.
http://www.programurl.com/photoshop-speedup.htm

The www.acropdf.com seems to be off the air at the moment, so this interesting little product may not be available much longer. —

Mike Russell
I’ve included a copy of this, and other postings at:
www.curvemeister.com/forum/
X
x2lls
Oct 3, 2006
On Tue, 03 Oct 2006 17:24:46 -0400, maria
wrote:

This has been puzzl;ing me for quite a long time.
I am watching the RAM usage on my computer, especially
when I load Photoshop. How come Photoshop does not release the RAM that the loaded images occupy as soon as they are closed? Isn’t the memory required for them in RAM?
The entire RAM memory is released only when the program itself is closed.
Thanks!

maria

Could it be that until windows requires it, then photoshop will retain it?
You could test that by running many other programs after closing images in PS and see if PS releases it. That’s the way , for instance, SQL Server works.
DF
Derek Fountain
Oct 4, 2006
The entire RAM memory is released only when the program itself is closed.

That’s typical behaviour for most modern operating systems. As others have said, it makes sense to assume that if an application has required a large chunk of memory once, it will likely require it again. UNIX has worked that way from the start back in the late 60s, and BSD (i.e. OS X) and Linux have also always done it that way. There are techniques based around the concept of "over commiting" that mitigate the problems of such wasted memory when the machine is under memory pressure.

Windows and earlier versions of Macs were designed in days when large amounts of RAM were unusual, so the OS did things in a very different way. According to Mike’s post, the application did it’s best to work around that. :o)

In short, it’s working as designed. Don’t worry about it.

Master Retouching Hair

Learn how to rescue details, remove flyaways, add volume, and enhance the definition of hair in any photo. We break down every tool and technique in Photoshop to get picture-perfect hair, every time.

Related Discussion Topics

Nice and short text about related topics in discussion sections