Hacker News new | ask | show | jobs
Memory Compression in Windows 10 RTM [video] (channel9.msdn.com)
28 points by khellang 3928 days ago
5 comments

Watched the video the other day, enjoyed it. Note that this already exists in OS X since Mavericks and in Linux since 3.11, although it's not enabled by default on any distro AFAIK (more info: https://www.kernel.org/doc/Documentation/vm/zswap.txt).

Related: I wish Apple did more things like this, videos explaining the internals of the system. The OS X kernel source code is open but you need a deep understanding of Mach and OS internals to understand what's going on. And most processes and services running on the background are closed source and who the hell knows what's going on.

Apple has been very serious about not wanting you to know what's going on in your machine since around 1984. The first Mac needed an extra-long hex wrench to open, a very uncommon tool at the time. They want good developer communities for good apps, yet they don't give them full control.
I don't know about "not wanting you to know what's going on in your machine." It's more like they want you to treat their public OS API as "the machine": a clean black-box abstraction layer you can build on.

What goes on underneath, while interesting, is not guaranteed to be stable. They might, say, replace x86 with ARM one day, as they already replaced PPC with x86. If you're targeting "the OSX platform", that doesn't affect you; you just hit rebuild in XCode. If you're targeting the underlying computer, you're screwed. Apple doesn't want you to be screwed (really, they don't!), so they try to disincentivize relying on anything below the public API.

Compare this to Microsoft, where the Windows team deals with cases like these[1] by inserting compatibility shims to keep the behavior of applications using undocumented, non-public-APIs (or munging kernel-shared opaque structs, even) stable between OS releases. While it's great for end-users—their apps don't break—it incentivizes relying on private APIs, because Microsoft will effectively keep your app running for you.

[1] http://blogs.msdn.com/b/oldnewthing/archive/2003/12/23/45481...

How is that relevant to a video like this? It's not something you can leverage directly by tapping into a private API or something. It's just information about how it works, which indirectly can benefit you as a programmer but the technique itself is transparent and could be removed tomorrow without any (other) consequences (unless I missed something, didn't watch the whole thing).
Is memory shortage really a problem these days? Frankly, if you have like 12-16GB of RAM, which is realistic even for notebooks, and you don't have 200 browser tabs open or work on very special tasks, you'll never fill that RAM. In fact, I've been running Windows 7 with paging disabled (no pagefile to lessen SSD wear. Turns out that was not necessary since you'd have to page astronomic amounts to wear it noticeably) for years and never had a problem. I mean, yeah, he mentioned 1GB Ram tablets, I see the point there.

Overall very informative and he's good at explaining. At first I thought the concept was stupid but it's actually clever. Also: "If you have enough memory [...] nothing is gonna get compressed either." So it's not like this slows you down if you don't have to worry about memory size (like me).

Yes, and it's becoming worse for each year. Ultrabooks has at best 8 GB but 4 GB is the norm (at least last time I looked). And if you look at Surface Pro etc. 4 GB is the norm and 2 GB is mainstream. I might be 6 months out of date or something but regardless the current state is quite appalling. I'm writing this on a computer from 2008, and it has 8 GB of ram (and I've never updated it, I would have done it if the motherboard supported more)...
Win10's OEM licensing is forcing the restart of 2GB DDR3 module production: http://www.dramexchange.com/WeeklyResearch/Post/2/4118.html
> In fact, I've been running Windows 7 with paging disabled.

You should never disable the page file, no matter how much physical memory you have. Just set it to system managed and it will usuyally sit around 1-2Gb usage.

For explanations as to why you shouldn't disable it;

https://superuser.com/questions/810170/should-i-disable-swap...

https://serverfault.com/questions/23621/any-benefit-or-detri...

http://www.howtogeek.com/126430/htg-explains-what-is-the-win...

The way windows handles virtual memory hasn't changed much up to Windows 7. Windows 10 changes it up a bit but you still shouldn't be disabling it completely.

My experience on an i4790k machine with 8 GB RAM after "upgrading" to Win 10:

Chrome tabs tend to get swapped out to SSD quite quickly. Re-opening those tabs takes a few seconds now, compared to instantly before. Am pondering adding another 8 GB for a total of 16 to see if it helps...

I was running Windows 7 with an HDD and just upgraded to an SSD & Windows 10 because I got sick of listening to my HDD groan for 10 seconds whenever I changed tabs :)

I wonder you're experiencing a use case where you'd see notable perf improvements from a pcie ssd. Jeff Atwood blogged about his upgrade to a faster ssd last week: http://blog.codinghorror.com/building-a-pc-part-viii-iterati...

Of course, assuming you have unused RAM, it would be nice if the OS would just use the RAM available before swapping to SSD.

I have 32GB in my workstation for exactly one app. That app is a browser. It's name starts with C.
Today 8GB of ram is a minimum for web browsing, unfortunately :(
Nonsense. I have a Windows 10 laptop with 2 GB of memory and it browses very happily. Just don't use Chrome.
Ironically, my little C720 Chromebook running Chrome OS with 2GB of ram browses pretty decently as well. But it also only has 1366x768 of screen real estate to worry about...
This is a pretty sad state of affairs with the modern web.

I have an old Linux box running with 4GB of ram under my desk right now and it is borderline unusable for surfing the web with Chrome if I have any other applications open in the background. Firefox isn't as bad but it is also not a pleasant experience either.

At home, I have a laptop with 2GB of ram that I've upgraded to Windows 10 and the Windows Edge browser is also virtually unusable because of memory usage with more than a couple of tabs open.

What makes you say this? It's not even remotely true.
It's good that they're putting some work into the memory subsystem. My experience on Windows 7 has been that it occasionally makes really bad memory management decisions; in particular, if left overnight with a backup client running (which will read the whole filesystem once through), I'll come back and find everything has seemingly had its process memory paged out, so each program and each tab will take some time to recover when I start using it again.
If it just weren't "the one hand giveth the other hand taketh away."

I don't use Windows 10 but I read that the uncontrollable updates which take long time are very annoying. Is it really that bad?

They aren't that annoying in my opinion since Win10 will ask you to schedule a reboot in advance (within 3 days I think).
The Pro version of Windows 10 doesn't force updates. You can buy a full license for $200. Or, use "Anytime Upgrade" on a Win7 Home box, get a Pro license for $90, and then use the free upgrade to Win10 Pro from there.
I only use Windows 10 in a VM for browser testing but I just disable the Windows Update service. I have a PowerShell script which can enable it, hang around and disable it again later which I use when I want to do updates, i.e. when I'm not busy focusing on a task.

I guess it will slightly reduce the overall security but as I only use it as a VM and am generally testing locally its an acceptable trade off in my opinion. The reason I set it up this way was to avoid the time sinks that come from when I do use Windows and then have to wait an age for updates to be done when I'm focusing on work. Previously I always used the option to be notified about updates rather than auto install which was a reasonable trade off. I understand why Microsoft made the change but I strongly disagree with it.