top | item 45675370

A question about memory management

1 points| alex77456 | 4 months ago

Not trying to start an argument - genuinely curious, and would like to hear from people more knowledgeable than me.

Every discussion about pagefile, swap, virtual memory, ssd wear, having exessive ram, etc, seemingly always boils down to "ssd's are cheap, you'll never run out of writes, please turn pagefile back on and stop worrying about it". I know the truth is somewhere in the middle, (and was not 'worrying' in the first place) so just couldn't go along with it.

(I'll simplify while keeping it truthful) I have 32 gb of ram. Disabled pagefile as an experiment. Allocated a 4gb ramdisk for personal use. Under heavy load, memory hungry apps were indeed occasionally crashing, leaving 'low virtual memory' event log entries. Ram usage never exceeded about 75%. From what i could find, lack of continuous allocation seems to be the culprit. So i added a 2gb pagefile on the same ramdisk. Not a single hiccup since.

I feel like i've been gaslit. Am I missing something? I'm not suggesting everyone to start disabling their pagefile/swap, but surely memory management could be better than what we have now? I've not tested on linux yet but have a feeling will see a similar result.

9 comments

order

p_ing|4 months ago

> I know the truth is somewhere in the middle

Don't disable the page file, if you have 32GiB RAM, it's usage will generally be low unless you're doing something 'heavy', at which point if you're regularly doing that, add more RAM. Some applications absolutely require a page file and will not function without one (Adobe Photoshop is or was one of them).

The truth is not in the "middle". The truth is you should ignore people who peddle uninformed advice on the Internet about how to "optimize" your computer when they themselves don't understand the NTVMM.

alex77456|4 months ago

So in the described scenario, what advantage does an ssd-backed pagefile has over a ramdisk-backed one? Assuming the same sizes.

Because the common recommendation is "you need at least a few GB swap". We can change the total ram amount to 64 or 128.

pestatije|4 months ago

the question seems to be: is better 30gb ram + 2gb ram swap, or 32gb ram + ssd swap? id say full ram + disk swap cause itll be harder to reach the limit...once it gets to the limit speed is irrelevant and what really matters is that processes don't die

alex77456|4 months ago

No, the question is 30gb + 2gb ram swap vs 30gb + 2gb ssd swap