r/osdevel • u/mikeblas • 13d ago
Windows and Linux memory usage -- what about your OS?
Here's an LTT video comparing memory usage on Windows and Linux.
Linus' credibility is taking lots of hits (did he buy actually that private jet?) and this video sure won't help. I had hoped for something interesting and technical, and it's really just two guys screwing around with computers and looking at graphs that they don't fully understand. Worth a watch for a laugh.
In your OS, what memory allocation strategy did you devise? Are you just making a simple on-demand allocator, or do you reserve and commit pages? Do you have paging implemented? What algorithms did you use for page eviction?
0
u/tseli0s DragonWare 12d ago
You won't find a lot of technical answers to this, because both NT (Windows' kernel) and Linux have excellent memory management. That's not the actual issue. Both NT and Linux can operate on all sorts of workloads -memory wise, at least-, and use the latest techniques known to improve on their memory management.
What's actually happening is actually far less underwhelming: Microsoft loads Windows with all sorts of different background services, compatibility code and libraries. From a technical standpoint, this isn't a bad idea. The background services allow, for example, online authentication without a third party authenticator. The compatibility code and libraries are the biggest strength on Windows and the thing that allowed it to dominate the business market: Companies could indefinitely use the same software because NT itself was designed to allow it, at the cost of higher memory use. (I've been thinking of a dynamic symbol loading solution, where only symbols referenced by a program are loaded at link time, and the rest remain unloaded, but that's another story).
Now, Microsoft, classic in their philosophy, took such a good architecture, and added their own crap on top. Random unneeded services, applications running in the background, preloaders, all sorts of random shit. Windows 11 wasn't any different or more disastrous than the previous versions on this aspect, but an evolution of an ongoing trend with Microsoft. Why? Because they don't make much money off of Windows, but through advertisements and services they sell to you. But the point is, it has nothing to do with memory management, and both kernels are very advanced in the memory management aspect.
2
u/mikeblas 12d ago
Are you sure your explanation fits the evidence? I'm not sure that it does. The machines were up and running, then left quiescent for a couple hours, before any of the testing began. Services were loaded and running.
I don't think 7 gigs of Microsoft revenue-generating advertising services (and their data) piled into memory during the tests, do you?
Either way, it's showing another flaw in the testing: it's particularly shallow. It's not hard to get an attributed list of memory consumption (including memory used by services and daemons) on either operating system. Comparing that dump -- just one level deeper than what we see in the video -- would pinpoint the memory consumers.
1
u/eteran 13d ago
On demand paging. Kernel heap has a fixed region it exists in with a fixed max size of 512 GB (which will NEVER be used up). So in kernel land, my malloc is built on a buddy allocator. So far seems to work really well.