Pages: [1]   Go Down

Author Topic: Photoshop CC 2014: Scratch file despite plenty of RAM?  (Read 8584 times)

sm906

  • Full Member
  • ***
  • Offline Offline
  • Posts: 126
    • thomas hintze fotografie
Photoshop CC 2014: Scratch file despite plenty of RAM?
« on: November 15, 2014, 02:59:22 am »

Hi folks,

yesterday my workstation arrived (6-core XEON E5-1650 v2, 64GB RAM, still Window 7 64bit before Win 8.1 upgrade next week). I made some first tests to compare the performance of the new workstation over my old PC (i5-2500K, 32GB RAM).

My expectation was that when PS has enough RAM (dedicated 42GB to PS according to PS perfomance settings) that the scratch file will disappear, at least until the RAM is not too close to be eaten up by running applications. This proves to be wrong. Even though overall RAM consumption is only around 15GB (during first tests) PS wrote a 10GB scratch file to the disk as soon as the first image was open.

Do I have to worry about my workstation investment, because PS will still constantly swap data back and forth to the scratch file, even though there is plenty of RAM unused, leading to a still slowed down system despite the fast but unused RAM?

or

Is this a "security issue" of PS? And the scratch file will only be used when the systems is in danger of running out of (RAM) memory?

Kind regards

Thomas


Logged
nature-architecture-panorama-fineart
Web hintze-photo.com | YT youtube.com/c/rawakademie

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8914
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #1 on: November 15, 2014, 04:06:42 am »

Hi folks,

yesterday my workstation arrived (6-core XEON E5-1650 v2, 64GB RAM, still Window 7 64bit before Win 8.1 upgrade next week). I made some first tests to compare the performance of the new workstation over my old PC (i5-2500K, 32GB RAM).

My expectation was that when PS has enough RAM (dedicated 42GB to PS according to PS perfomance settings) that the scratch file will disappear, at least until the RAM is not too close to be eaten up by running applications. This proves to be wrong. Even though overall RAM consumption is only around 15GB (during first tests) PS wrote a 10GB scratch file to the disk as soon as the first image was open.

Hi Thomas,

For some (historic?) reason, Photoshop always creates a scratch disk file. Also check the preferences for the intermittent writing of a backup file of the work in progress.

Quote
Do I have to worry about my workstation investment, because PS will still constantly swap data back and forth to the scratch file, even though there is plenty of RAM unused, leading to a still slowed down system despite the fast but unused RAM?

Two things you can do before worrying. First thing is to assign the scratch disk file to a fast dedicated SSD. Second, you could create a RAM-disk and have Photoshop write its scratch file data there.

Cheers,
Bart
Logged
== If you do what you did, you'll get what you got. ==

Torbjörn Tapani

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 319
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #2 on: November 15, 2014, 09:56:11 am »

Really nothing more to add to what Bart already covered.

It is just the way Photoshop works. Always writing history or recovery states to disk. This is why some research and careful planning of drives and SSDs are good before you build a new system. You want to separate system drive and adobe scratch on different SSDs but RAW files can be on conventional or even external drives without much penalty.

With 64 Gb I would opt for RAM-disk primary scratch and SSD as second scratch. You can change the order in preferences.
Logged

deejjjaaaa

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1170
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #3 on: November 15, 2014, 10:38:48 am »

Do I have to worry about my workstation investment, because PS will still constantly swap data back and forth to the scratch file, even though there is plenty of RAM unused, leading to a still slowed down system despite the fast but unused RAM?
If you have plenty of RAM unused then you absolutely do not need to use SSD, use only RAM disk - RAM disk has througput 10-100 times more than SSD (RAM = teens of gigabytes/sec)

this is a free RAM disk = http://www.ltr-data.se/opencode.html/#ImDisk and FAQ how to use (options) = http://reboot.pro/topic/15593-faqs-and-how-tos/

Logged

sm906

  • Full Member
  • ***
  • Offline Offline
  • Posts: 126
    • thomas hintze fotografie
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #4 on: November 15, 2014, 12:47:08 pm »

Thanks a lot for you reassuring words. PS and the new worksstation cooperate well, things run smoothly with my 5-10GB PSB image files while editing.

RAMdisk indeed is an option I have in mind. But, observing the scratch disk today (on a Samsung 840 EVO SSD) growing up to 60GB after having worked on three images during the last two hours, and the total RAM not even exceeding 40GB, suggests to ideally install another 64GB of RAM for the RAMdisk, just to please an outdated PS concept with another huge amount of money!?

I do understand that the scratch disk is still there and that it is usefull, when there is not enough RAM left. But I do not understand why there is the need for such a huge scratch file, when there is more than 20GB RAM unused.

Is there no way to limit the scratch file and force PS to firstly use the RAM?

BTW, saving such files after an editing session took around 9 minutes (!). Most of the time PS tells it needs to collect the data necessary and shows 0% saved. Which lets me assume that PS grabs the date from the scratch disk instead of having them in memory!?

Still a bit confused and disappointed...

Thomas

Logged
nature-architecture-panorama-fineart
Web hintze-photo.com | YT youtube.com/c/rawakademie

sm906

  • Full Member
  • ***
  • Offline Offline
  • Posts: 126
    • thomas hintze fotografie
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #5 on: November 15, 2014, 12:51:31 pm »

Also check the preferences for the intermittent writing of a backup file of the work in progress.

Bart,

where can I check this setting?

Kind regards

Thomas
Logged
nature-architecture-panorama-fineart
Web hintze-photo.com | YT youtube.com/c/rawakademie

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8914
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #6 on: November 15, 2014, 01:09:16 pm »

where can I check this setting?

Hi Thomas.

In CS6 it's in the file handling preferences (see attachment).
Don't know about Photoshop CC 2014.

Cheers,
Bart
Logged
== If you do what you did, you'll get what you got. ==

deejjjaaaa

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1170
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #7 on: November 15, 2014, 01:10:49 pm »

Hi Thomas.

In CS6 it's in the file preferences (see attachment).
Don't know about Photoshop CC 2014.

Cheers,
Bart

in CC2014 = preferences -> file handling -> automatically save recovery information every :
Logged

deejjjaaaa

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1170
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #8 on: November 15, 2014, 01:11:55 pm »

But, observing the scratch disk today (on a Samsung 840 EVO SSD) growing up to 60GB after having worked on three images during the last two hours

what are you settings in preferences -> performance ? screenshot of the dialog window
Logged

sm906

  • Full Member
  • ***
  • Offline Offline
  • Posts: 126
    • thomas hintze fotografie
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #9 on: November 15, 2014, 02:10:58 pm »

in CC2014 = preferences -> file handling -> automatically save recovery information every :

I've got it. I never took care of this feature. According to the PS default value it is set to 10 minutes. I will turn if off and see what happens...and will come back with the result.

Thanks so far guys.

Thomas
Logged
nature-architecture-panorama-fineart
Web hintze-photo.com | YT youtube.com/c/rawakademie

Redcrown

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 507
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #10 on: November 16, 2014, 12:45:33 am »

I was curious about this issue, having never paid much attention to the Photoshop scratch file (other than to move it off the system drive.)

I poked around for a while and was amazed I what I saw. Hardly extensive tests, but I used the Windows Process Monitor (Procmon) to watch activity on the Photoshop scratch file while doing some basic editing.

I'm no expert on Procmon. In fact, I'm quite confused on what it calls an "operation". There are about 50 operations with cryptic names (like IRP_MJ_QUERY_SECURITY). But some of them have the words "IO", "Read", or "Write" in them, so it seems safe to assume they show I/O.

I saw a ton of "writes", but never saw a "read" operation. And the "writes" happened when you might expect, but also when you would not expect. For example, I added adjustment layers and saw no activity against the scratch file. But then I just hit Ctrl-t to start a transform and a bunch of "write" operations showed up.

So it seemed to me that Photoshop is using its scratch file for a lot of miscellaneous things, not just for swapping out memory. In fact, the name "Scratch" instead of "Swap" is a hint at that. I always thought of it as a "swap" file. It probably is that, but a lot more.

Mostly I banged away on small files, well below my available ram. But I also created one huge file to exceed my ram allocation. The scratch file got a lot bigger, of course, but the amount of activity reported by Procmon didn't seem to change much. Most strange, I thought, was that I never saw a "read" operation, even on the huge file.

Bottom line, there is a lot of scratch file activity, so keeping it on your fastest drive is certainly a good idea.

Google turns up very little about the Photoshop scratch file. If anybody finds a comprehensive source I'm sure we would all like to know.
Logged

sm906

  • Full Member
  • ***
  • Offline Offline
  • Posts: 126
    • thomas hintze fotografie
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #11 on: November 16, 2014, 01:46:27 am »

...Mostly I banged away on small files, well below my available ram. But I also created one huge file to exceed my ram allocation. The scratch file got a lot bigger, of course, but the amount of activity reported by Procmon didn't seem to change much. Most strange, I thought, was that I never saw a "read" operation, even on the huge file....

Redcrown,

great research and insights into the mystery of the scratch file!

When there are almost exlusively write operations it might indicate that it is needed for backup reasons--at least in addition to other things--in case PS crashes for some reason. Anyway, the scratch file is always being used and is constantly growing even when "automatically save recovery information" is turned off, as I observed finally. And can get very always very large. So, the question is: What are the other things the scratch file is doing and in which way and to what extent do they affect performance?

Update: PS generates more than one scratch file on the same drive for the same session, as soon as the first scratch file has reached the size of the total RAM. At least this seems to be obvious based on the 64GB available in my computer (see screenshot).

As Redcrown wrote, a comprehensive source on the sratch file mystery would be very much appreciated.

Kind regards

Thomas


« Last Edit: November 16, 2014, 10:00:16 am by sm906 »
Logged
nature-architecture-panorama-fineart
Web hintze-photo.com | YT youtube.com/c/rawakademie

Pictus

  • Full Member
  • ***
  • Offline Offline
  • Posts: 216
    • Retouching
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #12 on: November 16, 2014, 10:00:29 am »


Less "History States" and smaller "Cache Tile Size" may result into smaller scratch disk size, also read this.
Logged

Redcrown

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 507
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #13 on: November 16, 2014, 03:04:42 pm »

More fooling around with Procmon watching the scratch file....

The scratch file grows but never shrinks. Of course it goes away completely when you close Photoshop, and gets recreated each time you launch.

Adjusting History states and Cache tile size has no effect. Photoshop still writes something to the scratch file even with History States set to 1. Do stuff and it keeps writing to scratch, apparently keeping only one history state inside Photoshop, but lots more outside Photoshop.

Purge all history, see History shrink inside Photoshop, but no writes to the scratch file and no reduction in scratch file size.

Load an image, get about 20 write ops. Dupe the background, get none, dupe again maybe get some maybe not.

Add a Levels layer, get none. Adjust the Levels, get none. Add a Curves, get some. Adjust Curve, get none. Paint with a brush or clone, get tons. And so on and so on. Sometimes it writes, sometimes not. Sometimes a little, sometimes a lot. Still never reads, but I suspect Procmon is lying to me. It's got to be reading sometime?
Logged

Schewe

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 6229
    • http:www.schewephoto.com
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #14 on: November 17, 2014, 03:08:24 pm »

For some (historic?) reason, Photoshop always creates a scratch disk file.

I remember back with the release of Photoshop 3.0 (back in 1996 I think) the entire memory management of Photoshop changed. Prior to that, if an image and the image undo could fit in ram, Photoshop didn't create a scratch disk file.

Starting with 3.0 however, the revised scratch disk scheme ALWAYS creates a scratch disk based loosely around the amount of ram Photoshop was allocated at launch and growing based on the things Photoshop needed to cache.

If you are working with enough ram to keep the Efficiency readout on the main document window to 100%, then the only thing Photoshop will write to the scratch disk is history and a few other maintenance routines related to caching and it will do so in the background while Photoshop is idle waiting for you.

If your Efficiency drops below 100%, Photoshop will offload parts of it's ram cached data to the scratch disk in an oldest first order. Depending on how far under 100% you are, Photoshop may force the caching to a foreground process and slow down Photoshop's operations while cashing. Best to avoid this...

The memory management has evolved over the years–most recently when Mac & Windows went to 64-bit operating OS's (to access a lot more ram). But, the fact remains, Photoshop ALWAYS creates a scratch disk on launch. Ideally, you should put your main (you can have up to 4) scratch disk on your fastest non-boot drive. Putting the scratch disk on your boot drive mains Photoshop may end up competing with the OS's system paging. On a Mac, you often end up seeing the Spinning Beach-ball in those cases.

Photoshop will keep as much of the image in ram as possible as long as you have enough ram to hold the image and the first Undo-the rest of History is stored on the scratch disk.

While it may be interesting to ponder how Photoshop does what it does, it's not terribly useful other than to learn how best to manage ram & scratch disks.
Logged

Tim Lookingbill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2436
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #15 on: November 17, 2014, 03:20:41 pm »

One more reason I try to do everything in ACR and save to embedded xmp sidecar.

Wonder how ACR deals with Ram, caching and scratch disc.
Logged

deejjjaaaa

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1170
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #16 on: November 17, 2014, 04:21:52 pm »

Wonder how ACR deals with Ram, caching and scratch disc.

acr has an option to setup cache - so you can check
Logged

Schewe

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 6229
    • http:www.schewephoto.com
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #17 on: November 17, 2014, 06:23:58 pm »

Wonder how ACR deals with Ram, caching and scratch disc.

ACR get's it's ram from the host app, Photoshop. It doesn't have an ability to use a scratch disk...does need it. However, it seems to get along fine without it unless you open a lot of raw images at once in ACR. In that case, working between images becomes slower...you can tell that because the yellow warning triangle shows up as ACR is loading the image to preview. Some people load up a lot of images in ACR (some people open hundreds), adjust images and hit the batch save. It can be an effective workflow depending on what you are doing and have to deal with a lot of images. It's not something I normally do.
Logged

Tim Lookingbill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2436
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #18 on: November 17, 2014, 08:41:07 pm »

ACR get's it's ram from the host app, Photoshop. It doesn't have an ability to use a scratch disk...does need it. However, it seems to get along fine without it unless you open a lot of raw images at once in ACR. In that case, working between images becomes slower...you can tell that because the yellow warning triangle shows up as ACR is loading the image to preview. Some people load up a lot of images in ACR (some people open hundreds), adjust images and hit the batch save. It can be an effective workflow depending on what you are doing and have to deal with a lot of images. It's not something I normally do.

Some good FYI, Jeff. Thanks.

I can load up about four to five 6MP images at a time in ACR 6.7 and apply edits to one, save to xmp, select and apply those edits to the rest without a slow down. I've got 8GB of system Ram. However, where it gets slow is jumping back and forth between each at 100% zoom and waiting for their previews to normalize. After that, edit tweaks aren't a problem working on each individually.

I'm guessing bumping up Photoshop's Ram allocation would make ACR act a bit more zippier?
Logged

Schewe

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 6229
    • http:www.schewephoto.com
Re: Photoshop CC 2014: Scratch file despite plenty of RAM?
« Reply #19 on: November 17, 2014, 10:04:27 pm »

I'm guessing bumping up Photoshop's Ram allocation would make ACR act a bit more zippier?

Yes, up to a point.
Logged
Pages: [1]   Go Up