Skip to main content
Participant
June 4, 2024
Question

memory leak after working on multiple psb files

  • June 4, 2024
  • 1 reply
  • 229 views

It looks like there could be a memory leak after working on multiple large psb files. I was working on about 20 psb files, back to back. I would open the file, work on it, and close it. After about 20 files, memory useage was 20gb. 

This topic has been closed for replies.

1 reply

D Fosse
Community Expert
Community Expert
June 4, 2024

That's not a memory leak. That's intended and normal behavior.

 

Photoshop uses memory up to the limit you set in Preferences, and this will get used very quickly. That memory is not released when you close the file. It is reused and recycled. This is by design, because requesting memory from the OS for every file would be much slower - you can imagine what it would do for batch processing, for instance. It would make batch processing almost unworkable.

 

Raster image editing requires huge amounts of memory, much more than any RAM you may have installed. That's why you need to set a limit in Preferences. The bulk of it is handled by the scratch disk. Think of RAM as a fast access cache for the scratch disk's main memory. RAM only handles a small part of it.

 

The scratch file - which equals Photoshop's total memory requirement - contains all history states for all open documents, plus overhead for advanced functions like smart objects. The new AI-based functions have huge memory requirements.

 

The memory is released when you close Photoshop, not before.

 

The memory allocation in Preferences should not be set too high. The default is 70%, and you should normally not go above that. Depending on how much you have, you need to leave a good amount for the rest of the system, because Photoshop's allocation will be saturated very quickly, and stay there.