The wibbly wobbly world of Windows memory use.
Windows memory management is a right pig to understand. I’ve wasted hours reading up on it and I admit that I don’t understand it fully. Here’s what I have gleaned, remember that this is my take on it and I’m happy to be wrong. If a Windows guru can shed more light on the matter, feel free.
Windows treats all your memory as fair game, when a program loads, it does not have any idea what the memory requirements are for the program. So it gives the program a fat dollop of memory for it to play in. When you think about it, it does make some sense, why bother to give a program a small amount of memory when one of the first things it does when it runs is ask for some more memory? Windows does not know how much memory the program needs and plays safe by giving it a chunk of the available memory. If the program never requires more memory to run, Windows does not have the overhead of having to allocate more memory to it. In systems with gigabytes of memory, why let 70% of it never do anything useful until the system becomes more stressed?
For instance, I can create a program that’s nothing more than a window, with a button on it that displays “Hello, World” in a message box when the button is clicked. That was given 14.5 megabytes of memory, according to TaskManager. Is my program using that memory? Of course not.
What Windows giveth, it also takes away. As Windows gets more stuff loaded, it will remove memory from applications. I’m not sure how it works out what programs get memory removed, like I said, it’s a pig to understand.
A few years back, I got into the mindset of how to make Windows use less ram. I finally realised that it made very little difference having a computer that after boot, had 1.4Gb free or 1.8Gb free. The biggest impact I could have on performance was to keep badly written software off it in the first place. I went for software that does a job well, and does not pretend to be all things to all people. I ask myself questions like do I really need an instant messenger? No? Disable it. Do I need a bloody google toolbar on my browser(s)? No? Don’t install it or Yahoo’s effort. iTunes? No, if I want to buy music, then I go to a record store and buy a CD or order it from Amazon. Then I rip it onto mp3 at better quality.
Sorry, getting off topic. A poster commented that, after getting back from lunch, XP had swapped his apps to the swap file. Yep, Windows does that, if a program is doing bugger all, why keep it in ram? Bung it in the swap file and let programs that are doing work have the ram.
I’m not saying this good or bad, but for a SDD manufacturer to moan that it’s the operating systems fault for their poor performance is silly.
And, memory does get fragmented, if program A uses 10mb and you load some more programs, then program A requests more ram, its likely to get ram that’s nowhere near the programs original address space. Fragmentation on a SDD drive is no different than fragmentation on a HDD. The only difference is that one is reading and writing ones and zeros in a block of memory and the other is moving ones and zeros across magnetic platters.