0

We all know that a modern OS will save power by throttling the CPU (or even putting it to sleep) when it isn't needed. But what about the RAM? After all, DRAM can't be powered-down without losing its contents, even when the machine is in sleep mode.

But maybe not all of the DRAM needs to be powered all the time. Since RAM is packaged in discrete modules (DIMMs), it sounds feasible for the OS to "compact" the active memory into as few DIMMs as possible, and then disable the unused DIMMs. (Thanks to virtual memory addressing, it should be possible for the OS to move RAM contents around without disrupting running programs.)

So the question is: Does macOS actually save power in that way? Or do all of your RAM chips stay on and fully powered, even when you aren't actually using all of your RAM capacity?


Side note: I know that macOS has different "sleep modes", and in some of them, the RAM is powered down completely (after its contents are saved to disk). I'm not asking about those other modes. I'm asking about the default sleep mode, in which the contents of RAM are not restored from disk upon power-up.

1 Answers1

1

Compared to other devices in the system DRAM memory is a paltry saving.

If you have multiple DIMMs then your system may be using them in dual channel (or higher if you have a workstation CPU) and it would be a juggling trick to copy used memory out of one DIMM to another, to disentangle the dual-channel mode and shut down a DIMM.

Chances are a higher power saving could be made by, say, marginally limiting the CPU peak clock rate, shutting down a mechanical hard disk, or throttling the GPU.

DIMMs are one of the relatively low power devices compared to all the other major power systems in a computer and there is little benefit to them having anything like this level of granularity of power control.

I doubt the memory controller in processors is even capable of dynamically hotplugging memory banks on the fly. I suspect the system would have to effectively hibernate (checking if it might fit in a single DIMM, halt the processor, and then restart the processor in single channel mode with a channel disabled to load memory contiguously on a single DIMM (if the working set fits).

Mokubai
  • 95,412