5 ms·
Odd, but effective, Windows Fix
- cabirum 14y agoDefault Power Options setting is to turn off hard drives after 20 mins. Any r/w operation would require it to spin up which can take up to 30 secs, during this time the app behind that becomes unresponsive. Seems like the possible cause for me. Anyway, disabling swapfile is not a fix, merely a way to hide symptoms of the problem.
- coffeeaddicted 14y agoYeah, 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.
- EwanG 14y agoFWIW, 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.
- barrkel 14y agoNo 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.
- coffeeaddicted 14y agoI'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.
- barrkel 14y agoI'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.
- coffeeaddicted 14y agoNot 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.
- barrkel 14y agoI 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.
- justanotheratom 14y agopowercfg /change disk-timeout-dc 0 powercfg /change disk-timeout-ac 0
- masenf 14y agoI'm not sure why the pagefile would even be in use if your system operates with 4.5Gb free memory...
- davux 14y agoFrom the comments: http://serverfault.com/a/23684 http://serverfault.com/a/23684
- codinghorror 14y agoI 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...
- EwanG 14y agoIt 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 14y ago[deleted]
- donpdonp 14y agoThe 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.
- EwanG 14y agoProbably 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 :-)
- reneherse 14y agoYou 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. ;)
- rosstafarian 14y agoMark 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/WCL405 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/WCL406 http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/WCL... part 2
- JBiserkov 14y agoI'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!
- codinghorror 14y agothis is, and has always been, a bad idea per http://serverfault.com/a/23684 http://serverfault.com/a/23684
- keeperofdakeys 14y agoOf 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.
- rosstafarian 14y agowindows 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 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.
- keeperofdakeys 14y ago