It looks like the script doesn't clear memory after it's finished running:


The memory remains taken until I close Photoshop entirely. After opening the file again the usage looks a bit more reasonable:


Script: downloaded from repo today
Photoshop: 22.5.6 (I couldn't run the script on the latest 23 version - something about an invalid layer name)
OS: Windows 10 Home