Memory issue with sips (scriptable image processing system)

254 Views Asked by At

sips -- scriptable image processing system is not releasing memory after Resampling image.

find /Users/parag/Desktop/image -iname "*.jp*g" -or -iname "*.gif" -or -iname "*.ti*f" -or -iname "*.png" -print0| xargs -0 sips -Z 800 -p 800 800

Every time my system free memory goes down whereas the inactive memory shoots up and it reamins the same even when the command has finished execution. My Image folder contain 300 images. why does't the memory get freed ??

Before running the command
enter image description here

After enter image description here

2

There are 2 best solutions below

5
On BEST ANSWER

You should focus on 'Active' and 'Wired' memory sizes, not on 'Free'.

1
On

Yes this is indeed how mac os manages its memory considering the principle of referential locality. The idea is that if you opened an application you are somewhat likely to do so again and if the memory is still labeled, the application can start very quickly i.e. some sort of caching is done. From the two snapshots , you will find that your inactive memory has gone up while your free memory goes down. Thats where your memory space has gone !!!

In the absence of sufficient free memory, inactive memory will be reclaimed by another running application that needs memory.