-1

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

Parag Bafna
  • 22,812
  • 8
  • 71
  • 144

2 Answers2

1

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

pronvit
  • 4,169
  • 1
  • 18
  • 27
  • Okay, but Every time my system free memory is going down when i am running sips command, why? – Parag Bafna Nov 30 '11 at 09:16
  • 1
    Because your memory may be actually free (ready to use by another apps if needed) but listed as 'Inactive' in activity monitor, not as 'Free'. Also system may cache something when you run your command, this memory also will not be listed as 'Free'. – pronvit Nov 30 '11 at 09:29
  • Okay, i got it, but why does't memory get freed for other application? its increasing inactive memory. – Parag Bafna Nov 30 '11 at 09:36
  • 1
    It's just how osx manages memory - it caches as much as possible. I currently have only 16mb free memory and 1gb inactive :) – pronvit Nov 30 '11 at 09:44
  • is it idea of temporal locality? – Parag Bafna Nov 30 '11 at 09:47
1

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.

ping localhost
  • 479
  • 3
  • 22
  • Thank you, I also got good reference for mac memory http://sg80bab.blogspot.com/2007/03/is-my-mac-using-too-much-memory.html – Parag Bafna Nov 30 '11 at 12:44