Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You put your page file in a Ramdisk? We need to go deeper...


Mainly to avoid the Windows page file from getting fragmented on a HDD, since fragmentation on a RAM disk is a non-issue. I keep my home desktop PC on most of the time and don't reboot often unless switching OSs.


If you have RAM free, Windows shouldn't be using your page file. If you have so little RAM free that Windows is paging, then using even more RAM to host the pagefile will make things worse. You might as well just turn off the pagefile entirely.


Windows likes to use it regardless of the amount of RAM you have free. Page File on Windows is unfortunately not as friendly as the swap area on Linux (where what you said is true).

Currently I have 8 GB free (out of 24 GB) and the page file is sitting at 944 MB (up from 96 MB) after rebooting about 12 hours ago. Windows has always been this way regardless of the version.

Turning it off is also not a good idea as Windows does use it regardless of free RAM.


If moving some data to disk helps performance by freeing up RAM, then putting the swap file back in RAM won't help because it's just taking up RAM again. Or, if you're just worried that Windows is putting things in the swap file that would perform better if they were kept in memory, it would be just as effective to disable the page file to force them to be in RAM. Either way, there's no improvement.


If you read my previous posts, the page file is far from the only reason I have a ram drive. Since I use it for lots of other things and I rarely use all of it, I might as well put my page file there as well. I also have 24 GB of RAM so not overly worried about storage.

I regret mentioning the page file, because it always starts some sort of silly debate on any forum it's discussed (Google yields tons of results).


Windows does things like swap out applications which are minimised or not recently used to allow more space for disk cache. You're neatly defeating the point of swapping them out by keeping the page file in ram.

You are still shuffling pages in ram in order to "swap" them though. The gp is correct. To achieve your goal, disable the page file. Having it on the ram drive entirely defeats its purpose; The ram backed page file won't help you in the case of memory exhaustion, and it doesn't allow the OS to put the ram to better use where it judges that possible. It's your machine and your perogative, but it is daft, and people are going to point that out.


Defeating it is a good thing. I don't want to waste time waiting for programs when I unminimize.

And windows gets cranky without any swap at all. When I 'disable' swap I always set it to 20MB or something.


> If you have RAM free, Windows shouldn't be using your page file

http://serverfault.com/questions/23621/any-benefit-or-detrim...

    Many people seem to assume that Windows pushes data into the pagefile on
    demand. EG: something wants a lot of memory, and there is not enough RAM to
    fill the need, so Windows begins madly writing data from RAM to disk at this
    last minute, so that it can free up RAM for the new demands.

    This is incorrect. There's more going on under the hood. Generally speaking,
    Windows maintains a backing store, meaning that it wants to see everything
    that's in memory also on the disk somewhere. Now, when something comes along
    and demands a lot of memory, Windows can clear RAM very quickly, because
    that data is already on disk, ready to be paged back into RAM if it is
    called for. So it can be said that much of what's in pagefile is also in
    RAM; the data was preemptively placed in pagefile to speed up new memory
    allocation demands.
And this is another good reason to have at least a token pagefile. Without any virtual memory all the memory a program requests gets allocated right away.

    Removing pagefile entirely can cause more disk thrashing. Imagine a simple
    scenario where some app launches and demands 80% of existing RAM. This would
    force current executable code out of RAM - possibly even OS code.
There are references for more detailed reading listed in the provided link.

edit: I also do the same thing as yareally with my pagefile, though I have much less RAM than him.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: