There’s a fascinating new post up on the Building Windows 8 Blog from Steven Sinofsky, dated October 7, 2011. It’s entitled “Reducing runtime memory in Windows 8”, and it digs into lots of interesting tricks and techniques that Microsoft is using to bring down memory consumption for Windows 8 overall, and to make best use of available memory even on devices equipped with as little as 1 GB of RAM.
Here’s an example of the kinds of insights this blog post contains “…minimizing memory usage on low-power platforms can prolong battery life.” That’s because RAM consumes power all the time it’s in use, so “…the more RAM you have on board, the more power it uses, [and] the less battery life you get.” Sure, I knew that from a simple energy consumption basis, but I’d never really put it in those terms before, probably because my computing universe has hitherto assumed a constant supply of power from a wall circuit rather than a limited reservoir of battery-based juice.
Other interesting tidbits in this posting include how designers used “memory combining” so the Windows memory manager could identify duplicate bits of data or information, then store them only once, instead of as many times as the OS and applications choose to store them (any time such info is written to, a private copy is created and allocated to prevent inconsistencies). Another trick is to change services so that they start only when they’re used, and consume memory and other system resources only IF they’re used. Old fashioned usage and visitation analysis applied to memory also let MS observe memory usage, and allocate runtime memory only for things likely to be referenced and used sooner rather than later. This plays into a more strategic notion of memory prioritization (what to keep resident and what to swap out after a period of inactivity) that helps the OS make better use of available physical RAM. And finally, given the differences between the Metro UI and the older desktop UI in Windows 8, the OS can defer memory allocation and use for desktop UI stuff only when it’s needed rather than automatically upon system startup. This, too, affords some useful savings (23 MB, according to the blog post, for the current preview version of Windows 8).
All in all this adds up to some interesting memory savings and optimization, and also explains somewhat more of how Windows 8 internals function, and how they compare to Windows 7. It’s starting to look like MS is taking the whole mobile device aspect of things very, very seriously!