Odd, but effective, Windows Fix(a1.blogspot.com)
a1.blogspot.com
Odd, but effective, Windows Fix
http://a1.blogspot.com/2012/06/my-fix-for-windows-8-freezes-and.html
6 comments
Yeah, took around 5 seconds here to wake up when I right-clicked in VS because of that. My swapfile is on a second HD which is not running much otherwise, and this also caused me regular freezes. My workaround was increasing the time to 60 minutes, which probably uses up some more power, but seems to be enough to avoid running into this problem in my usual workflow.
FWIW, but all my drives are set to timeoff "Never" because I would rather pay a little more in electricity. Per one of the other comments, even if the drive is spinning, Windows checks the page file first to see if it already "knows" about the file. In many cases that check takes longer than a modern drive would take to seek-find-copy. IMNSHO, Page files are an old solution that need to be rethought given the newer hardware that many of us are using.
No page file generally means apps crash hard when they reach the limit of memory. On a multi-tasking OS not set up for making individual applications hibernate, that's a recipe for data loss.
Back in the days of 16-bit Windows, we had this thing called cooperative multitasking. It sucked. It meant that a single unresponsive application could potentially lock up the entire system, and you'd lose all apps. Now, we have preemptive multitasking. The OS calls the shots. Without a page file, we'd be back into a similar situation re memory: a single app could consume most of the system, and all other apps would fail on allocation - and most apps are not written to be stable in the face of allocation failures. It's either that, or background apps would need to be suspended or killed arbitrarily by the OS, or some other kind of drastic limitations on productive work.
I have 16GB of memory in my system; but I regularly run utilities that consume a large fraction of that (enough that the 12GB in my previous system was starting to look pokey - and my prior system with 8GB IIRC, I had to run utilities sequentially instead of in parallel to avoid page thrashing). The advantage of having lots of memory is that you can write utilities that build massive in-memory data structures. Problems are way easier to solve when you can rely on being able to stuff everything into a big hash table, rather than worry about temporary files on disk, or god forbid faffing around with a database and losing orders of magnitude of performance.
Page files, even in the presence of large amounts of RAM, are what enable this approach on workstations, in two ways: it means you won't suffer an app crashing from out of memory as you skirt the line of maximum physical memory; and secondly, and probably more importantly, page files backing allocated pages means the OS is able to free up memory sooner for those applications that demand it.
If you use your computer for casual use and don't stress it or do much critical work with it (i.e. use it much like you would a phone or tablet), you can get by just fine without a page file. But if you actually want to use the thing, a page file is a very handy thing to have.
Back in the days of 16-bit Windows, we had this thing called cooperative multitasking. It sucked. It meant that a single unresponsive application could potentially lock up the entire system, and you'd lose all apps. Now, we have preemptive multitasking. The OS calls the shots. Without a page file, we'd be back into a similar situation re memory: a single app could consume most of the system, and all other apps would fail on allocation - and most apps are not written to be stable in the face of allocation failures. It's either that, or background apps would need to be suspended or killed arbitrarily by the OS, or some other kind of drastic limitations on productive work.
I have 16GB of memory in my system; but I regularly run utilities that consume a large fraction of that (enough that the 12GB in my previous system was starting to look pokey - and my prior system with 8GB IIRC, I had to run utilities sequentially instead of in parallel to avoid page thrashing). The advantage of having lots of memory is that you can write utilities that build massive in-memory data structures. Problems are way easier to solve when you can rely on being able to stuff everything into a big hash table, rather than worry about temporary files on disk, or god forbid faffing around with a database and losing orders of magnitude of performance.
Page files, even in the presence of large amounts of RAM, are what enable this approach on workstations, in two ways: it means you won't suffer an app crashing from out of memory as you skirt the line of maximum physical memory; and secondly, and probably more importantly, page files backing allocated pages means the OS is able to free up memory sooner for those applications that demand it.
If you use your computer for casual use and don't stress it or do much critical work with it (i.e. use it much like you would a phone or tablet), you can get by just fine without a page file. But if you actually want to use the thing, a page file is a very handy thing to have.
I'm sure page files make sense. But if a page-file starts freezing applications regularly for seconds with typical settings and hardware, all while there is still sufficient main-memory, there seems to be some rework necessary indeed.
I've never had page file activity "freezing applications regularly for seconds" since the late 90s. I'm not sure what's causing what you're talking about; it sounds like a dodgy hard drive.
Not dodgy, just a sleeping hard drive. Modern HD's sleep when unused and take that long to wake up - that's not really unusual. People just don't notice that as much if they have a single HD as that is usually active most of the time you are working. But with 2 HD's (typical SSD + HDD combination) you often have one HD sleeping and will run into this a lot more thereby. There's ways to work around it - putting the page file on the HD which is more active or not allowing the HD to sleep as often. But my favorite would still be to simply prevent Windows from even using the page-file before the memory is at least used up to 50% - which would nearly never happen on my system for example.
I don't let my HDDs sleep for this very reason (my main drive is indeed SSD). Your heuristic would fail pretty badly on my machine; faced with an allocation for 8GB (not unusual for my utilities), I would have to wait while about 6GB of memory is paged out. That latency would be far worse than any delays from paging.
powercfg /change disk-timeout-dc 0
powercfg /change disk-timeout-ac 0
powercfg /change disk-timeout-ac 0
Mark Russinovitch did a great talk on how windows uses memory. I highly recommend checking it out if you're curious about this sort of thing
http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/WCL... Mysteries of Memory Management Revealed,with Mark Russinovich (Part 1 of 2)
http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/WCL... part 2
http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/WCL... Mysteries of Memory Management Revealed,with Mark Russinovich (Part 1 of 2)
http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/WCL... part 2
The title is disturbingly close to "Fix windows with this one weird trick."
A couple years ago I googled for "windows vista thrashing" and found a number of good guides that say what services to turn off and it was a huge performance boost.
A couple years ago I googled for "windows vista thrashing" and found a number of good guides that say what services to turn off and it was a huge performance boost.
Probably because I saw a posting on here some time ago (sorry I can't pull the link off the top of my head) that explained why you saw "Odd" and "Weird" on so many ads on the Weather Channel site. Given that this is my highest voted HN submission in some time, and my highest single day visit to my blog, I'd say that there was probably some science behind this :-)
You just made me realize how much my "web annoyance" factor has actually gone down since I installed ad blockers and don't have to see those "with one weird trick" ads anymore. They're really the worst of the worst IMO. (But I am glad that you were able to legitimately repurpose the phrase in this case.)
I'd love to see the article you mentioned, but I shudder to think of the search results were I to go looking for it. ;)
I'd love to see the article you mentioned, but I shudder to think of the search results were I to go looking for it. ;)
I've disabled the page file on all my systems since I had more than 128 MB RAM. Increased performance every time. System has never crashed, individual programs rarely do since Windows is pretty good about warning you. A funny thing I noticed on my first XP box (256 mb): whenever I ran out of memory, Winamp got killed. Don't know why, but it was no coincidence - I've reproduced this a hundred times, showing it to friends, etc. there was no memory leak in Winamp - it's memory usage was constant. Maybe the system figured out it had no files open in write mode, so killing it would be harmless. Anyone heard of something like this or have another explanation? Windows killed user processes in reversed alphabetical order?! :)
tl;dr; determine peak usage, install twice the memory, DISABLE virtual memory, profit!
tl;dr; determine peak usage, install twice the memory, DISABLE virtual memory, profit!
this is, and has always been, a bad idea per http://serverfault.com/a/23684
Of course this always depends on your use-case. If you have more ram then you use (say double), you would never notice the effect of this behaviour. I have a linux laptop with 8GB of ram, and no swap, since the SSD is rather small. It takes a few days to fill up the ram (with file buffers). The programs I run will never approach the amount of ram I have, so I am fine with no swap.
windows doesn't have "swap" watch those videos i linked for more info on how it works and a few people pasted
http://serverfault.com/a/2368 which has excellent info.
There are many reasons to have a paging file even if you have plenty of ram. If you get a bluescreen it has to use the paging file for the memory dump if you want one, etc.
There are many reasons to have a paging file even if you have plenty of ram. If you get a bluescreen it has to use the paging file for the memory dump if you want one, etc.
I was trying to highlight that in some cases the user won't notice any benefits associated with page file when they have a large amount of RAM, so it is not really a negative to have it disabled. Personally I have encountered times when Windows, having paged processes, knocks them out of memory when I have plenty free (I know the memory is used for file caches, but I would prefer it to kick this stuff out first). As for mentioning linux, I was using it as an example (albeit only slightly applicable).
>There are many reasons to have a paging file even if you have plenty of ram:
1. If you have a BSOD and you want a memory dump
2. e
3. t
4. c
5. .
1. If you have a BSOD and you want a memory dump
2. e
3. t
4. c
5. .
Sorry but i didnt feel like going into the specifics of windows memory management when i and others gave you the resources to learn more, so i listed one common case that everyone can appreciate. As per your original post I find that completely dubious saying windows never crashes after you disabled your paging file. Windows generally bsod's because of 3rd party driver's(70% of the time, and yes that's a real statistic). So i find it very hard to believe that it never crashes let alone what your lack of page file has to do with anything. Maybe it was blue screening and you where too busy making winamp crash hundreds of times and posting snarky comments on HN to notice?
I'm not sure why the pagefile would even be in use if your system operates with 4.5Gb free memory...
From the comments:
http://serverfault.com/a/23684
http://serverfault.com/a/23684
I hope people read that link, because this "we don't need no steenking pagefile!" meme comes up like clockwork every year and it's wrong every time...
It comes up every year because it's correct. I have read and am familiar with the issue raised in the linked article, and respectfully disagree. I just think that if I can edit a Video file, record my voice over, and have my email running in the background without using all my RAM that it is time to take another look at how modern OS should work with memory.
[deleted]
Anyway, disabling swapfile is not a fix, merely a way to hide symptoms of the problem.