by matthew smith, john allred, chris fulton

14
By Matthew Smith, John Allred, Chris Fulton

Upload: ura

Post on 07-Jan-2016

17 views

Category:

Documents


0 download

DESCRIPTION

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

TRANSCRIPT

Page 1: By Matthew Smith, John Allred, Chris Fulton

ByMatthew Smith, John Allred, Chris Fulton

Page 2: By Matthew Smith, John Allred, Chris Fulton

RequirementsRelocationProtectionSharingLogical OrganizationPhysical Organization

Page 3: By Matthew Smith, John Allred, Chris Fulton

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

Page 4: By Matthew Smith, John Allred, Chris Fulton

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

Page 5: By Matthew Smith, John Allred, Chris Fulton

Relocation and Logical OrganizationTLB uses a LRU policy to load

pages into its memoryMain 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.

Page 6: By Matthew Smith, John Allred, Chris Fulton

Physical OrganizationEach process has its own page directory and page tables that

take 4MB per processIn 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

Page 7: By Matthew Smith, John Allred, Chris Fulton

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

Page 8: By Matthew Smith, John Allred, Chris Fulton

Vista’s ImplementationBasically the same in Vista 32 bit, memory size

limitations change with 64 bit addressingVista Basic tops out at 8GB by designVista Home tops out at 16GB by designVista Business, Enterprise and Ultimate can exceed

128GBActual 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

Page 9: By Matthew Smith, John Allred, Chris Fulton

PerformanceThese numbers are relative every system is a little

different, these are to access different memory typesRegister time250psL1Cache time: 1ns, 4 times slower then RegisterRam or main memory time: 10ns, 10 times slower then

cacheHard disk time: 10ms, 1000 times slower then ram

Page 10: By Matthew Smith, John Allred, Chris Fulton

Memory OptimizationUse ram to avoid using Virtual MemoryMove virtual memory off disk that hold boot and system

partitionsFormat with NTFS with 4KB Clusters (defaults to this), with

4KB page sizesLet Windows manage the virtual memory size. If you have a Raid-0 drive use it to store the pagefileDo not use a fault tolerant drive, like Raid 1 or Raid 5Don’t touch the rest of memory management in general,

things that “Free” up your ram don’t improve performance most of the time.

Page 11: By Matthew Smith, John Allred, Chris Fulton

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

Page 12: By Matthew Smith, John Allred, Chris Fulton

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

Page 13: By Matthew Smith, John Allred, Chris Fulton

DemoOf Pre-fetchOf Virtual Memory BenefitInteresting 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.

Page 14: By Matthew Smith, John Allred, Chris Fulton

CreditsOptimization:

http://www.petri.co.il/pagefile_optimization.htmAMD 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 Custerhttp://articles.techrepublic.com.com/5100-22_11-

5109810.html registry tweak.http://saladwithsteve.com/2007/07/disk-vs-ram-round-1.html