1 / 14

By Matthew Smith, John Allred, Chris Fulton

By Matthew Smith, John Allred, Chris Fulton. Requirements. Relocation Protection Sharing Logical Organization Physical Organization. Sharing.

ura
Download Presentation

By Matthew Smith, John Allred, Chris Fulton

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. By Matthew Smith, John Allred, Chris Fulton

  2. Requirements • Relocation • Protection • Sharing • Logical Organization • Physical Organization

  3. Sharing • Lazy evaluation: Philosophy used in windows memory manager to wait until as late as possible to avoid doing and expensive operation. Like paging to hard disk. • If two process are going to be using the same page the memory manager will mark it as read only and map both of the process’s virtual address’s to a shared page. • Copy on write, if the memory may want to be written but can be shared to start, then if a process writes , it will copy it and write it to that process’s memory.

  4. Protection • Unless shared the process’s cannot access each others memory. • Each page has access flags to determine types of access allowed. • Read only, Read/Write, Execute only (if hardware supports), Guard Page, No Access, Copy on Write • Memory has a kernel mode and a user mode.

  5. Relocation and Logical Organization • TLB uses a LRU policy to load pages into its memory • Main Memory uses a local replacement policy, with global scope, each process has a dynamic number of pages assigned in main memory • If a page fault occurs new page brought in and other removed to virtual memory based on LRU if no room is left, on a per process basis.

  6. Physical Organization • Each process has its own page directory and page tables that take 4MB per process • In a 4 byte address 10 bytes for lookup in page directory index for the correct logical page. • 10 bits for lookup in the page table to find actual base physical page • Last 12 bits are an offset for within the base physical page you looked up previously. • This scheme prevent process over righting each other because each process thinks it has all the memory to itself

  7. Memory Implementation • 32 bit addressing allows 4GB of address space in XP, with PAE (Physical Address Extension) allows up to 128 GB mostly for servers and datacenters • 4 KB pages in original implementation, can vary from 4KB to 64KB • Each process see’s 4GB of address space, 2GB is reserved for kernel level threads. 2GB for process and user level threads, kernel level threads may access. • You can change the kernel space to 1GB with 3GB for process and user level threads, for memory intensive applications. • Process may use as much as they want of this 2GB, though it may mean putting it in virtual memory.

  8. Vista’s Implementation • Basically the same in Vista 32 bit, memory size limitations change with 64 bit addressing • Vista Basic tops out at 8GB by design • Vista Home tops out at 16GB by design • Vista Business, Enterprise and Ultimate can exceed 128GB • Actual memory limit with 64 bit addressing is 16 exa-bytes(I wonder what we would use it for)‏ • Aggressive pre-fetching (Super Fetch), based on previous use, of pages into main memory, its suppose to use all your ram

  9. Performance • These numbers are relative every system is a little different, these are to access different memory types • Register time250ps • L1Cache time: 1ns, 4 times slower then Register • Ram or main memory time: 10ns, 10 times slower then cache • Hard disk time: 10ms, 1000 times slower then ram

  10. Memory Optimization • Use ram to avoid using Virtual Memory • Move virtual memory off disk that hold boot and system partitions • Format with NTFS with 4KB Clusters (defaults to this), with 4KB page sizes • Let Windows manage the virtual memory size. • If you have a Raid-0 drive use it to store the pagefile • Do not use a fault tolerant drive, like Raid 1 or Raid 5 • Don’t touch the rest of memory management in general, things that “Free” up your ram don’t improve performance most of the time.

  11. Shows opening idle, then opening firefox, and then opening windows media center.

  12. Comparison • Linux and Windows XP have surprisingly a lot in common when it comes to memory management, including copy-on-write, shadow pages, management daemons, memory-mapped files, and interprocess communication • Windows uses a local working set scheme, but employs a process (Balance Set Manager) to check every second whether or not the working sets are adequate. • Linux only invokes its memory manager when a page fault is generated • Windows uses a dynamically allocated portion of the hard drive for virtual memory, which is mingled with data and sometimes results in segmentation. • Linux uses a separate swap partition for virtual memory.

  13. Demo • Of Pre-fetch • Of Virtual Memory Benefit • Interesting change in regsitry: HKEY_LOCAL_MACHINE\SYSTEM\ CurrentControlSet\ Control\Session Manager\MemoryManagement “DisablePagingExecutive” you could change this value from 0 to 1 it will move all your core system and user level drivers to main memory, have at least 512 MB of Ram. Other programs may suffer, because of thrashing.

  14. Credits • Optimization: http://www.petri.co.il/pagefile_optimization.htm • AMD TLB error http://www.anandtech.com/cpuchipsets/showdoc.aspx?i=3260&p=2 • http://www.windowsitlibrary.com/Content/356/04/1.html • “Windows NT” by Helen Custer • http://articles.techrepublic.com.com/5100-22_11-5109810.html registry tweak. • http://saladwithsteve.com/2007/07/disk-vs-ram-round-1.html

More Related