Thread: Disabling VM
View Single Post
  #4  
Old October 8th, 2001, 04:12 AM
lgerbarg lgerbarg is offline
Registered User
 
Join Date: Oct 2001
Location: Cupertino, CA
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
lgerbarg is on a distinguished road
Quote:
Originally posted by kenny

That said, given the way memory management is done on Unix (and Windows now, too), there is likely NO WAY to turn it off without some serious modifications to the kernel. Memory managers set up the memory address space in such a way that it is not practical yet to fill that space with real memory. For instance, 32-bit system allows for up to 4GB of memory (2^32 = 4294967296). The memory manager sets up a full 4GB of space, and since there isn't nearly as much in actual memory, paging is likely, nay - certain, to occur.
That is not at all how things work. Our system sets up a 4GB memory region for every app, and the kernel. All of the memory pages in them that are not actually in use are not mapped into real memory, and thus take no memory. As soon as everything on the system uses more ram than you have you will start hitting swap. I can allocate immense amounts of memory, until I actually use the memory it does not cost me anything besides a couple of bits in the page tables.

One important thing to remember is VM and swapping are different. VM just means you can remap one block of memory to another. Swapping general uses this by setting up the mappings for a program so that the pages that are swapped are marked as invalid. When a read or write occurs that triggers a processor exception, which the kernel can process. Hence swapping uses VM, but VM does not imply disk swapping.

Louis
Reply With Quote