[ros-dev] Guess who's back

Phillip Susi psusi at cfl.rr.com
Sat Apr 2 16:15:46 CEST 2005


Could you be any more specific?  Applications should not know or care 
about pagefiles, that's the business of the memory manager.  Most people 
have a misconception that if you have a gig of ram, it is a good thing 
to allocate 512 megs to a ramdisk and put a pagefile there, when in 
fact, it is better to simply have no pagefile at all and have a full gig 
of usable ram.  I say this because the entire reason for having a 
pagefile is to store data that can't fit into real ram, so by reserving 
half your ram for a ramdisk, you are creating the need for the pagefile 
in it.  If you leave that 512 megs of ram to the vm system to manage, it 
won't even need a pagefile since there will be a gig of physical ram to 
work with instead of only 512 megs.

Also you have to remember that most of the time, the pagefile is not 
used, it is only there as a last resort reserve pool of memory.  Unless 
the system is very heavily loaded, it isn't going to be used at all, so 
when you reserve 512 megs of ram for a ramdisk to hold the pagefile, 
most of that memory goes to waste.  Really even under maxium total 
commit, you still are not going to use the pagefile fully used because a 
good deal of virtual memory in the system is used to map shared physical 
pages of ram for things like dlls.  Each time the dll is mapped, it uses 
up virtual memory but only physical memory once, so when you map a 1 meg 
dll 20 times, you've used 20 megs of virtual memory, but only 1 meg of 
real memory.  Thus if you have 10 megs of ram and 10 megs of pagefile, 
even though you have 20 megs of used virtual memory, you are only using 
1 meg of ram, zero space in the pagefile, and have 9 megs of free ram ( 
though zero free virtual memory so more allocations will fail ). 

It's kind of like having an application that has its own file caching.  
It's using up memory to cache files that are already cached by the 
kernel cache manager, and using up memory that the kernel is better at 
allocating than the application is, so it's best to just let the kernel 
worry about caching and not the application. 



Richard Campbell wrote:

> ACTUALLY if you have the page file disabled it causes compatibility 
> problems with apps.  Windows is DESIGNED to have a page file.  So 
> rather than keeping a page file on disk...create it on a RAMDrive and 
> you keep apps happy and windows happy.
>
> Richard
>
> Phillip Susi wrote:
>



More information about the Ros-dev mailing list