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.