Thread: 2 questions concerning memory

  1. #1
    بابلی ریکا Masterx's Avatar
    Join Date
    Nov 2007
    Location
    Somewhere nearby,Who Cares?
    Posts
    497

    2 questions concerning memory

    hello all, i was reading an article concerning emulation ( simulation) , there i encountered two expressions which i dont know about!
    paged memory and mirrored memory!
    what are they? i've already given it a try! googled for paged memory! but no luck!
    all i got was bunch of articles on windows page file and stuff!

    and the same goes to the mirrored memory too! i found out sth ! about this but i don't precisely understand! in mirrored memory! the data is being writen in multiple locations! meaning if i write some data to the memory location #4000 , the exact data will be written to memory locations #6000 and for example #8000! why? whats the benifits of doing this ? !
    Highlight Your Codes
    The Boost C++ Libraries (online Reference)

    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.."
    Bill Bryson


  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Paged memory is just memory that is measured in pages. Memory is split up into bits, bytes, words, etc... And you can refer to locations as such. Byte 14 is exactly 1 byte after byte 13, and you can't use the byte that starts 4 bits are byte 13 - you have to start after byte 13 ends.

    A page is typically 4096 bytes (4kb) of memory - though "large page" implementations are out there. And like bytes, you have to refer to page memory by the first byte of the page and then provide an offset to access bytes inside that page.

    (as is my understanding, anyway...)

    I myself haven't used mirrored memory

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The only use of "paged memory" I've ever seen was as a synonym for "paged-out memory", i.e. parts of the address space that have been written to the swap space and removed from RAM.
    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

  4. #4
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    On modern systems with VM, all memory is "paged." But the term "paged memory" has a more specific meaning -- it means memory pages which can potentially get kicked out of RAM (either to swap, or to a file-backed store).

    This is in contrast to "unpageable memory" which, although still PAGED in the sense that it is virtual-mapped, is not allowed to be swapped out of RAM.

    The distinction is important when you are developing a kernel-level device driver. Certain driver functions may require that certain parts of memory can never be swapped out. For instance, driver interrupt handlers which access internal data structures. If these data structured were paged, then the driver could possibly experience a page fault while attempting to access them. Generally, taking a page fault while inside an interrupt handler is a very bad thing.

    A better term would have been "pageable memory" or "swappable memory" but "paged memory" is what we got.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  5. #5
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Paging is a mechanism for address translation between logical and physical memory in protected mode. Each application has access to a 4GB address space, but the processor can access up to 64GB of physical memory. The paging unit translates from teh lofical address, which the program uses, to the phjysical address wher ethat memory is lovcated using the global descriptor tble and the local descriptor tables. Because paging uses granularity, typically 4K per page, the pages do not have to be in any particular order in physical memory. So logical memory locations 0-4095 may be at physical location 0xFFFF0000 while logical locations 4096-8191 may be at 0x12340000, or any other physical location which lies on a page boundary. This lets the operating system allocate physical memory on demand as the individual process requires it, without having to allocate huge block of memory that may never be used. It also lets an application allocate more memory than physically exists in the system. The additional memory is virtualized as the paging file. If your system only has 1GB of physical ram adn the application allocates 2GB, the extra GB is stored on disk and loaded into ram as needed.
    Last edited by abachler; 03-11-2009 at 05:41 PM.

  6. #6
    بابلی ریکا Masterx's Avatar
    Join Date
    Nov 2007
    Location
    Somewhere nearby,Who Cares?
    Posts
    497
    thank you all! i really appreciate it!
    but does anyone happen to know sth about the benefits of mirrored memory!? i think thats a way to reduce memory access faults or sth! but i dont understand it properly ! can any one give me a hand id this matter too?
    Last edited by Masterx; 03-11-2009 at 11:59 PM.
    Highlight Your Codes
    The Boost C++ Libraries (online Reference)

    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.."
    Bill Bryson


  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    If you google for Mirrored Memory, it explains it fairly well on HP's Proliant web-pages, but in short:
    It works just like mirrored (RAID 1) disk setups: Everything is stored in two separate memory devices, and if one starts going bad, it can be unplugged and replaced whilst the system is still running (because the system can use the OTHER memory stick).

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

  8. #8
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    You know, come to think of it, theres no reason you couldnt impliment RAID in a memory controller and achieve hot swappable RAID 5 for your memory. Perhaps Ill design a memory controller to do this in my spare time.

  9. #9
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by abachler View Post
    You know, come to think of it, theres no reason you couldnt impliment RAID in a memory controller and achieve hot swappable RAID 5 for your memory. Perhaps Ill design a memory controller to do this in my spare time.
    You could, but the benefit over mirrored memory is negligible (if any), I'd say. Memory already has "built in" parity bits (that is, for servers, the memory controller has extra parity bits that are calculated on write and checked on read).

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

  10. #10
    بابلی ریکا Masterx's Avatar
    Join Date
    Nov 2007
    Location
    Somewhere nearby,Who Cares?
    Posts
    497
    Dears Thank you all again ! specially Mats, ( yeah , i noticed that little info on HP servers! but wanted to know more in details! after googling more i found a comprehensive article explaining it all! ) just simple and Great!
    Highlight Your Codes
    The Boost C++ Libraries (online Reference)

    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.."
    Bill Bryson


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 02-06-2009, 12:27 PM
  2. Random memory questions
    By Blackroot in forum Windows Programming
    Replies: 3
    Last Post: 04-04-2007, 09:33 PM
  3. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  4. Accessing Video Memory Information...need help
    By KneeLess in forum C++ Programming
    Replies: 8
    Last Post: 08-24-2003, 03:53 PM
  5. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM