What is the need of building systems where |V| < |R| when we usually see that systems with |V| >> |R| ?
|V| = The number of virtual addresses
|R| = The number of real addresses
What is the need of building systems where |V| < |R| when we usually see that systems with |V| >> |R| ?
|V| = The number of virtual addresses
|R| = The number of real addresses
You have 2^k addresses where k is the number of bits in an address. That limits the number of
virtual addresses you can have. The real addresses are limited by the amount of hardware you have, but you can always page out to disk.
>What is the need of building systems where |V| < |R|
to avoid thrashing? I'm not really sure what you mean.
Virtual Memory doesn't necessarily need to be mapped into physical memory. You can map a file into virtual memory. I don't remember what it was called, but it's a handy thing, if I'm not mistaken. Don't believe I've ever used it, though.
|V| < |R| means that you can have several processes that all can have their virtual address space completely mapped to real memory. Useful for things like virtual servers, or servers with some large processes (DB + web server, for example). That's the idea behind PAE on Windows.
Of course, the OS needs to be able to handle |R| somehow. If the |V| limitation is such that the OS can't handle all of |R|, the additional memory is simply wasted.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
As described above, PAE, and by extension, an x86-64 system running 32-bit applciations, will have more physical address bits than the virtual address bits - in a 64-bit system, the physical addresses are enough to achieve 256 times (or 65536 times) more memory than the 32-bit application space can achieve. [Although current memory sticks can't really achieve that sort of memory sizes, but I've heard of systems with 256GB of RAM]. PAE gives 36 bits of address space, but each application can only address 32 bits.
The reason for this is where you have MANY processes that each use a small-ish amout of memory, but because of the number of processes, the total amount of memory needed is greater than the addressabale range of each application.
For a 32-bit OS, at any given time, the OS can't see ALL of the memory. It relies on the page-tables to map the relevant sections into the virtual address space at any given time. This works reasonably well, as the application usually has a map of the memory it needs, and any memory owned by the OS itself will obviously be mapped in the "kernel space" [the part of the memory map that is always present in all processes, and that is not accessible by user-mode applications].
So, yes, it's perfectly possible to have such a system.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
matsp should write his own operating system. I'd use it.
Thank you all for your response!
CORNEDBEE
Can u please elaborate your concept bit more? Or any links from where i can read this concept!
I think matsp did.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.