Photoshop's temporary's file size only increases, but never decreases.
When working with photoshop, it automatically creates a temporary file saved to %appdata%.
The problem is that file never decreases in size.
If you add more images and increase their size, the file will grow in size, however if you delete them, the size will stay the same.
My assumption is you're allocating memory for the graphics, but never actually freeing it.
If this is working as intended, I would suggest freeing the memory after the user deletes or resizes the graphics, as this problem happened when I wanted to add more images to my project and I couldn't, because there was no more memory for it; I checked my disk and was almost full; surprised with it, I closed photoshop, from where the temporary file was deleted; it was occupying almost 100 gb of my ssd, but when I reopened it, not even 2gb.