News for hackers. Stuff that matters.
Re:macOS 10.15 Vista by phoe-krk on Wednesday October 09, 2019 @03:03AM (#21200776)
> It seems like that’s possible but it requires a swapfile to save state to.

Has macOS solved this issue differently? Do they save RAM state to some non-SSD non-volatile memory, or do they just not care and dump it to SSD anyway?

Re:macOS 10.15 Vista by eknkc on Wednesday October 09, 2019 @03:27AM (#21200895)
I believe they favour sleep mode where the ram is powered on and the state is kept alive on ram. Only when the sleep time goes too long or battery starts running low, they dump into SSD.
Re:macOS 10.15 Vista by Lio on Wednesday October 09, 2019 @09:23AM (#21202915)
It's not the swapfile that's the issue it's having the swapfile also be used for virtual memory.

If it was only used for suspend that would be fine because it would only be written to when you suspend the laptop, which in the grand scheme of things is pretty rare compared to writes caused by virtual memory swapping.

Re:macOS 10.15 Vista by chungus_khan on Wednesday October 09, 2019 @01:32PM (#21205574)
Mac OS does the same in this regard though, but in my experience neither Mac OS or Linux are particularly aggressive at using swap anyway.
Re:macOS 10.15 Vista by seba_dos1 on Wednesday October 09, 2019 @01:57PM (#21205906)
Yup, macOS dynamically allocates swap files on disk when they're needed - that's why you may see 0 swap space in htop, which doesn't mean that it doesn't use swap.
Re:macOS 10.15 Vista by Lio on Thursday October 10, 2019 @04:03AM (#21212021)
That’s interesting. I wonder can Linux be persuaded to dynamically alter the swap space from 0 as part of the suspend script?
Re:macOS 10.15 Vista by chungus_khan on Thursday October 10, 2019 @07:44AM (#21213307)
I think if you were to use a swapfile and set swappiness to zero it should behave like this.
Re:macOS 10.15 Vista by Lio on Friday October 11, 2019 @04:35AM (#21222543)
Brilliant! I think this is the going to be the answer. Have the swapfile but use swappiness to tell the kernel not to use it day to day. Thank you :D