1.

Solve : Page File - Windows 7 and 4GB RAM system?

Answer»

Ok 3 questions....

#1

A friend who is somewhat tech savy using this computer at work asked me why Windows 7 uses paging at all when there is plenty of free RAM. I was at a loss and so I am posting this question here?

It would make more sense if paging was 0MB until the system RAM was nearly completely consumed, but I never paid much attention to page file size, just mainly went with rule of thumb from ages ago and made it 1.5x whatever the system RAM size was so a system with 2GB RAM was 3GB page allocation or let Windows manage it to expand and shrink its allocation as needed on its own.

As for why this system is using 221MB of hard disk space for paging instead of 0MB when there is 2140MB Free ( available ).

#2

At what capacity of RAM does it make more sense to shut off paging for slightly better performance and have the system just run direct from RAM? My guess is that its OS version specific vs general. But with Windows 7 I have played with a system with paging shut off on a 4GB RAM system and had no troubles.

#3

Any Cons to having paging off with a system with adequate RAM?

[attachment deleted by admin to conserve space]#1 It's faster. If the system needs memory it is far faster to evict pages that are already swapped to the pagefile than it is to evict pages that are currently in physical memory, because in the latter case, now that data needs to be swapped out.

#2 It doesn't. The only possible speed advantage you can get by disabling the pagefile is that now your programs will never be swapped out, so you will be able to switch to that photoshop instance you launched last week. The problem is that when you do run out of memory, EVERYTHING is going down very, very, hard, because ALL attempts to allocate memory will start to fail.

As far as how big it is, the "Rule of Thumb" you mentioned dates back to Windows 3.1, and APPLIES to the Swapfile (which isn't EVEN a proper pagefile) that can be configured in 386 Enhanced Mode, and since it required you to enter a size, people came up with "rules of thumb" of what size to use. a 8MB system got a 12MB pagefile, for example.

Now, the "Rule of thumb" should be to set it to system managed on the drives you want a pagefile on.


#3 Almost every memory allocation on a modern application and platform is going to be a VIRTUAL memory allocation.

A program can allocate 2GB, but until it actually accesses that memory in it's virtual address space, it won't be "faulted in"- it won't "exist", neither in the pagefile nor on disk. In Windows' case, it will fail the allocation if it cannot guarantee that allocation. The design approach there is that if a program receives the OK from the memory allocation function for a 2GB block, and then uses over 512MB, Windows can't change it's mind when it realizes it can't actually find a place to FAULT in more memory. Even if it could tell the application somehow "oh, remember that 2GB you allocated and I said "yep, 2GB shouldn't be a problem", yeah well, something came up...". For example, if a Program allocates 2GB and there isn't 2 GB free, it will fail if the pagefile is disabled- even if the program only would end up using 512MB of that space. More importantly, that physical memory MUST be contiguous, too. If there is no paging file, a virtual allocation will fail if Windows cannot guarantee that the program will be able to use the full size of the virtual allocation, Which without a pagefile requires Windows to actually allocate that physical Memory. With a pagefile, both of these problems are non-existent. Windows can guarantee a 2GB Virtual allocation even if there is only one physical page remaining because the additional pages of the virtual allocation can be faulted in as they are accessed, and the memory manager can evict other pages back to the pagefile.

Furthermore, while not having a pagefile eliminates Windows ability to guarantee the size of a Virtual Allocation (Which is all memory allocations, really) and thus means that larger allocations are more likely to fail even if the program would have only used a single byte of the block before freeing it, you still only eliminate one of the pagefiles that will be used- Every single executable file on-disk is used as the "pagefile" for the executable code pages of a program.

Or, in very simple terms, Windows was designed to page and it always will. You cannot disable paging, only your ability to manage it.Reference:
http://lifehacker.com/5426041/understanding-the-windows-pagefile-and-why-you-shouldnt-disable-it



Discussion

No Comment Found