Hacker News new | ask | show | jobs
by pranau 2524 days ago
> I would love to see Windows not take up 4 gigs of RAM out of the box. Let me uninstall Cortana please Microsoft. I'm sure there's other crap I don't want but I fear if I can't just hit 'Uninstall' it wont go well, or an update will bring it back.

So much misinformation in this and the replies that address this. Windows needs a minimum of 2GB RAM to run. But it scales its memory footprint according to the available memory. It will instantly swap this out when a demanding application is launched. For reference, on my Thinkpad with 8GB of RAM, Windows idles at about 3GB. On my PC with 16GB, it idles at around 7.5GB.

4 comments

For reference, (with a Windows 10 system with 16GB of RAM) after several hours of light use, task manager reports that 2.7GB of RAM is used with 13GB available (other numbers report that 3.3/16.9GB are committed, and 2.8GB cached).
That is strange do you have any further points of reference on the matter? Preferrably a resource from Microsoft if possible.
You can verify some of this by examining a lot of the running memory bloat in https://live.sysinternals.com/procexp.exe (official diagnostics tool by sysinternals, a microsoft subsidiary), just make sure to elevate to see full process info with 'show details on all processes'.

On my machine a bunch of UWP apps are loaded passively in the background. A few are UWP apps I use occasionally, a few aren't. I don't know what heuristic they use for this. You might look at that and go - hey, wasted memory and CPU! However:

These apps are fully suspended, so they can't use any CPU at all. You can observe this in the procexp CPU column. Because they are fully suspended the OS can also instantly evict them when it detects memory pressure, similar to how the page caching system in OSes retains cached file contents in scratch memory to speed up I/O - if the memory used for caching files is needed for applications, the cache will be evicted to make space. Cortana, for example, is using 180mb of RAM for me right now but it is fully suspended so it can be evicted immediately to make room for another app. The upside is that when I hit start and begin typing Cortana search responds immediately.

The downside to this automatic eviction setup for background apps is that they will show up in memory usage statistics even though they're not really tying up that memory. It makes your system's available RAM a bit misleading. There are other modern apps that also respond to memory pressure - I believe Firefox will automatically compact its memory, you can manually trigger that in about:memory to see what it does.

I can also confirm that increasing the amount of RAM in my machine increased how much of it Windows was willing to use for preloading apps and caching pages, but I feel like that's not surprising.

Doesn’t this become an issue when your memory intensive apps close? Because after being evicted, wouldn’t Cortana and all the other stuff need a second to be reloaded into memory?
Yes, but the effect is the same as if files were evicted from the page cache: They get reloaded from disk when next used. Better for cortana to take an extra 750ms to load than for your other app to run out of memory.
Linux does the same thing, they both use RAM to cache disk reads for performance.
The tools on both generally show cache as free. The issue is not somebody misreading a chart.

If it was cache then the use would appear to be 98%

Win10 runs like crap on 2GB. They only support it to appease the bottom end of the market and stave off the threat of alternative low cost platforms.
Is there any way to tell it to use up less or more RAM? It would be very dumb if this weren't configurable
But why would you want you RAM to sit unused? The OS uses all the RAM available for caching if nothing else wants it for something more important.
Are memory-heavy applications able to detect true available memory? I could see an app that tries to scale itself to available memory running with reduced performance or refusing to run if it sees non-page-cache but evictable memory as unavailable.
You are over complicating.

In general applications don't manage their ram usage based on available resources they just take what they need until your system starts swapping.

The OS manages memory and evicts cache to make use for applications when they request it. The good thing about a cached file is that it is available on disk to be reread any time you like.

I've used applications that will specifically allocate (available memory * x) or similar because they or their plugins can't handle ENOMEM or the Windows equivalent, and they do not want to swap.
Those applications were broken anyways, see https://devblogs.microsoft.com/oldnewthing/20120118-00/?p=85...
If you can't answer this question for yourself, why do you think you'd be capable of modifying the factory default? Memory management is one of the most complex pieces of a modern OS