Skip to main content
Participating Frequently
January 23, 2025
Question

batch processing - clear cache / temporary files after each iteration?

  • January 23, 2025
  • 3 replies
  • 931 views

hi, when i do batch processing on large number of files i eventually run of disk space and the operation stops due to scratch fulling. i read that during the operation photoshop makes temporary files and that's why it takes 300gb after a few hours of running. all i need to do is restart the photoshop and the space is available again. but i have to start the process all over reconfigruing to not include processed images which takes time. and i can't leave it overnight because of that. is there a way to make it purge itself after each iteration for the already processed files? thanks 

3 replies

Known Participant
October 17, 2025

I have the same issue. As i batch generate 1.5k Jpgs i see disck space shinking. It only really clears after I quit photsohp. Have about 150GB free space. I get this on all my 3 M1 macs.

D Fosse
Community Expert
Community Expert
October 17, 2025

In this batch, is each file saved and closed before the next one is opened? If it is, the scratch file will recycle and never grow beyond what is needed for the biggest file.

 

If each file is kept open as new ones are added, then yes, the scratch file will keep growing, and it will not be cleared until you quit Photoshop. This is normal and by design.

Known Participant
October 17, 2025

It does close the file and opens a new one.

We work here with 3 macs. If we are working and saving many files in one day it will eventually fill the disk. Even if we are not batch generating anything. It only clears the disk if we quit photoshop.

I know it is weird, but it is what it is.

Conrad_C
Community Expert
Community Expert
January 23, 2025

I’m not sure if this will make a difference, but if this is an action or script you can edit, maybe have it periodically run one or more of the commands on the Edit > Purge submenu? For example have it process 100 images, purge, do the next 100, purge…

 

The History panel definitely uses scratch disk space, so you might at least want to try inserting Edit > Purge > Histories. But it might be simpler to just use Edit > Purge > All.

 

 

In addition, it just occurred to me that you might also try lowering the number of History States that Photoshop retains so that it doesn’t use resources trying to write them and keep them around; you would control that in Photoshop Preferences / Performance tab / History States value.

Participating Frequently
January 23, 2025

thank you but after purging everything disk space is still full. only quittung and relaunching photoshop again works 

D Fosse
Community Expert
Community Expert
January 23, 2025

As I said, in itself this is normal. It is reused, not deleted until you quit the application. That's as it should be.

 

What is not normal, is if the scratch file keeps growing beyond the size needed for the biggest file.

 

Because it comes up from time to time, I have tested this, closely monitoring the scratch file in real time. It does not grow, except when a file comes up that is bigger than any that was processed before.

 

It sounds to me like you just have too little disk space to begin with. If you have to work with limited disk space, reduce the history states as Conrad says. That will dramatically reduce the scratch size.

D Fosse
Community Expert
Community Expert
January 23, 2025

Does the action close the file before processing the next?

 

Photoshop reuses and recycles all memory (real and virtual/disk) as long as the application is running. Total memory requirement should never exceed that of the one biggest file in the batch.

 

If it keeps going up, there's something wrong going on.

 

Can you show a screenshot of the action, with all the steps opened/expanded so we see what it's doing?

Participating Frequently
January 23, 2025

I tried to record Close action but if I run with it the batch fails. I'm using override option with saving image as png copy. the images are about 300kb in size