Thread: Virtual Memory CONCEPT

  1. #1
    Anirban Ghosh
    Join Date
    Jan 2006
    Posts
    278

    Virtual Memory CONCEPT

    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

  2. #2
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    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.

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    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.

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    |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

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    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.

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    matsp should write his own operating system. I'd use it.

  7. #7
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Quote Originally Posted by Bubba View Post
    matsp should write his own operating system. I'd use it.
    Hey, that would be nice. Can we draft him into doing it?

  8. #8
    Anirban Ghosh
    Join Date
    Jan 2006
    Posts
    278
    Thank you all for your response!

  9. #9
    Anirban Ghosh
    Join Date
    Jan 2006
    Posts
    278
    CORNEDBEE

    Can u please elaborate your concept bit more? Or any links from where i can read this concept!

  10. #10
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    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

  11. #11
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by anirban View Post
    CORNEDBEE

    Can u please elaborate your concept bit more? Or any links from where i can read this concept!
    If you have a specific question, feel free to ask. I don't really think it makes sense for me to write up "most of what I know", but I'd miss the point that you were actually looking for.

    There's probably a heap of info about this on Wikipedia.

    --
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 01-13-2008, 02:14 AM
  2. How to minimize physical and virtual memory consum
    By dattaforit in forum Tech Board
    Replies: 4
    Last Post: 06-20-2007, 05:41 AM
  3. How to minimize physical and virtual memory consum
    By dattaforit in forum Windows Programming
    Replies: 1
    Last Post: 06-20-2007, 03:38 AM
  4. compilation error - virtual memory exausted
    By yevgeny in forum C Programming
    Replies: 1
    Last Post: 11-19-2001, 12:59 PM
  5. Exporting Object Hierarchies from a DLL
    By andy668 in forum C++ Programming
    Replies: 0
    Last Post: 10-20-2001, 01:26 PM