3

I am currently facing an issue with my MacBook Pro where it consistently runs RAM swap (or virtual memory) more often than the actual available RAM. Despite having a 16GB RAM capacity, I have noticed that only around 10GB of Ram is being utilized while the RAM swap usage keeps increasing.

This situation is causing performance degradation and affecting the overall efficiency of my MacBook Pro. I am puzzled as to why the system is relying heavily on RAM swap instead of utilizing the available RAM.

I have taken several steps to troubleshoot the issue, including:

  1. Monitoring the Activity Monitor: I regularly monitor the Activity Monitor to keep track of memory usage and processes. However, even when the memory usage is well within the available Ram capacity, the system continues to utilize the RAM swap.

  2. Checking for memory-intensive applications: I made sure to close any unnecessary or memory-intensive applications that could potentially consume a large amount of RAM. However, this did not resolve the excessive RAM swap issue.

  3. Updating the operating system: I ensured that my MacBook Pro is running on the latest version of macOS, as system updates often include performance enhancements and bug fixes. Unfortunately, this did not alleviate the RAM swap problem either.

I would appreciate any insights or suggestions from the Apple Stack Exchange community regarding this issue. Is there a specific reason why my MacBook Pro is relying heavily on RAM swap despite having sufficient RAM available? Are there any additional troubleshooting steps that I should consider to resolve this problem?

Screenshot of htop

4
  • See apple.stackexchange.com/questions/236881/…
    – Tetsujin
    Commented Jun 9, 2023 at 18:06
  • See this: apple.stackexchange.com/q/325098/119271 . You likely need a restart to free up that swap space. If I read your screen correctly, your Google Apps (I avoid them) seem to be resource hogs and the source of your problems.
    – Allan
    Commented Jun 9, 2023 at 20:01
  • Your Mac is using the available RAM. htop's "used" RAM is only wired+active RAM. Does not include RAM used as cache (orange) or compressed (dark blue). Activity Monitor makes it clearer that there is cache, and top includes cache and compressed in its figure for "used".
    – Gilby
    Commented Jun 10, 2023 at 1:01
  • Sorting by Resident Memory (not byCPU) and showing more of the Command might be useful for potential memory issues.
    – Gilby
    Commented Jun 10, 2023 at 6:21

2 Answers 2

3

You don't appear to have an issue with macOS's memory management.

All your RAM is being used. Some of this is a cache of pages not currently mapped to a running app, but available to be re-mapped as required. Memory management in macOS will make use of Compressed memory and SWAP before clearing all the cache.

Note that htop's figure for used RAM does not include what is used by the cache. For any app which shows a number for "used" RAM, you need to ask what is included in that value.

top (if you must use an app ported from Linux or other Unixes) presents a value for "used" RAM which does include all the cache.

Activity Monitor is more useful for macOS. Make sure you enable View All Process and use the Memory tab.

Is your SWAP usage a problem? If your Mac is responsive and Activity Monitor is not showing undue pressure then SWAP usage is not a problem.

You can also use vm_stat and watch how Pageouts, Swapins and Swapouts increase. Persistent changes in these do indicate your computer usage requires more physical RAM or a change in your activity.

If your performance is degrading (or you just want to reduce SWAP usage) you can a) quit applications that you are not currently using, b) close unused tabs in browsers, or c) reboot.

If performance continues to be degraded, you should investigate apps which are heavy users of RAM. For example, photo and video apps or browsers like Chrome (reduce number of tabs). Activity Monitor will help you find problem apps.

0

Solutions:

  • Reboot
  • Close all apps
  • Close Chrome and background services
1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Dec 14, 2023 at 21:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .