How to disable virtual memory on Mac OS for macOS

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.