The standard memory of MacBook Pro with Retina display is 8 GB, which is enough for daily use. Considering the hard drive life of SSD, we recommend that you disable the system's virtual memory (Swap) to avoid frequent writing. Disabling the system swap can also improve the performance (refer to Linux performance monitoring: Memory and Linux performance monitoring: IO swap ).
View the virtual memory currently in use:
$ Sysctl vm. swapusage
Vm. swapusage: total = 1024.00 M used = 354.50 M free = 669.50 M (encrypted)
After the virtual memory is disabled, the swap files used as the virtual memory are retained in the system, which can be deleted:
$ Sudo launchctl unload-w/System/Library/LaunchDaemons/com. apple. dynamic_pager.plist
$ Sudo rm/private/var/vm/swapfile *
After a period of time, you have not encountered system instability. If you find that the system is unstable, you can re-enable the virtual memory:
$ Sudo launchctl load-w/System/Library/LaunchDaemons/com. apple. dynamic_pager.plist
The virtual memory will use frequent read/write operations on the hard disk, which may cause a slight damage to the hard disk. Therefore, if your computer has a large memory, it is recommended to disable the virtual memory. It is still troublesome to break down the hard disk.