clear buffer cache on Mac OS X

前端 未结 5 1220
挽巷
挽巷 2020-12-30 04:46

Is there a way to programatically clear the buffer cache on the Mac, preferrably in C?

Basically, I\'m looking for the equivalent of the source of 10.5 (and greater)

5条回答
  •  不知归路
    2020-12-30 05:05

    It seems that:

    You can use usr/bin/purge (type purge in the terminal) to flush the disk cache (inactive memory), or you can do many random reads from the hard disk to do the same thing.

    Taken from a comment from user guns.

提交回复
热议问题