0

Firstly, I had disabled swapping and hibernatemode is set to 0

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist
sudo pmset -a hibernatemode 0

(macOS SIP was disabled when executing the commands above)

Secondly, I use fs_usage to monitor fs usage log when sleep

sudo fs_usage -w >fsusage.log

sleep time is about 8 hours.

What I'm looking for is that the Mac will sleep, and just sleep, doing nothing. But I got a 135M fsusage.log file, and when I analyzed the log file, I got some weird results.

Here is the analysis result:

  • The Mac always awake in certain periods of time.
  • The system doesn't swapping when normal use, but swapping when sleep.

    1. The most written CALL

      PgOut[ST1P] : 3726 (MB)
      
    2. The PgOut[ST1P] CALL write to the files:

      /dev/disk1  /private/var/vm/swapfile0 : 2443 (MB)
      /dev/disk1  /private/var/vm/swapfile1 : 1282 (MB)
      

PgOut size by timestamp:

05:55 : 1316 (MB)
06:56 : 1004 (MB)
07:12 : 143 (MB)
08:45 : 620 (MB)
08:46 : 25 (MB)
08:50 : 452 (MB)
08:51 : 163 (MB)

Sleep time is from 01:06 to 08:51

My MBP information:
MacBook Pro (13-inch, 2017)
macOS version: 10.12.6
memory size: 16GB

  • 1
    Did you disable Power Nap (... and I doubt that your Mac is really sleeping if you run sudo fs_usage ... in the background)? – klanomath Sep 23 '17 at 12:23
  • Swap sounds like exactly what you want to have happen before sleeping. Minimize ram contents, speed the wake and let power nap have a cleaner set of RAM while sleeping and dark waking. This could be a feature and a good thing. – bmike Sep 24 '17 at 0:04
  • @klanomath Power Nap has disabled. I think it is really sleep, because the timestamp of the log is discontinuous, just at some point (About one minute each time). – aliasw Sep 24 '17 at 1:46
  • @bmike I added "PgOut size by timestamp" in question description, It seems to be an swapping during sleep. – aliasw Sep 24 '17 at 2:14
  • Sorry, you want your Mac to do nothing while it's sleeping, so you told it to do something while it's sleeping, but now you're confused that it's doing something while it's sleeping... have you tried not giving it tasks to do while it's sleeping? – Alistair McMillan Sep 24 '17 at 8:48
1
  1. csrutil enable will cause swapping mode reopen.

    edit /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist file to disable it;

    then restart the SIP mode.

  2. Disable standby, autopoweroff, ttyskeepawake, tcpkeepalive in pmset:

    pmset -a standby 0
    pmset -a autopoweroff 0
    pmset -a ttyskeepawake 0
    pmset -a tcpkeepalive 0
    
  • 2
    What is "1. csrutil enable while cause swapping mode reopen." supposed to mean? It's not even a coherent sentence! – user3439894 Sep 27 '17 at 13:35
  • This seems to be a YZ-answer to a XY problem. – klanomath Sep 28 '17 at 12:25
  • @klanomath First thank you for edit the grammatical mistakes in my question. The above method does solve this problem, I am waiting for someone to provide a better one. – aliasw Sep 28 '17 at 13:45
  • @aliasw The whole problem is somehow comparable to Schrödinger's cat. But: if you smash the box, the cat is dead for sure. – klanomath Sep 28 '17 at 13:54
  • What is "1. csrutil enable while cause swapping mode reopen." supposed to mean? It's not even a coherent sentence! Additionally, the image you posted of the .plist file isn't at all clear what specific edit is to be made! You should have posted the text content not an image. While this incoherent answer may have solved your issue, as written it is a poor answer at best! – user3439894 Sep 29 '17 at 16:35

You must log in to answer this question.

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