Windows Memory Management
Windows Memory Management
Agenda
03-09-2012
Introduction to windows os
Microsoft Windows is a series of graphical interface operating systems
market.
Microsoft introduced an operating environment named /Windows/ on
November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces.
The most recent version of Windows is Windows 7.
03-09-2012
Windows uses demand paging with Clustering. Clustering handles page faults by bringing in not only the
faulting page but also the multiple pages surrounding the faulting page.
Windows uses clock algorithm.
03-09-2012
much as they wish of this full 4GB space as Virtual Memory, those
parts of the program and data which are currently active being loaded into Physical Random Access Memory (RAM).
03-09-2012
03-09-2012
4 Kilobytes each a size that has implications for managing virtual memory by the system.
Only some parts of the program and data that are currently in active
03-09-2012
= 262,144 GB
= 256 TB = 1024 TB = 16 TB
8
IA-64 today support 50 bits virtual = 1,048,576 GB 64-bit Windows supports 44 bits
03-09-2012
= 16,384 GB
User Accessible
(.EXE + .DLLs) A user-mode stack for each thread All static storage defined by the application
80000000
Kernel-mode accessible
Systemwide
FFFFFFFF
03-09-2012
User Accessible
wide data cells Page tables Kernel-mode device drivers File system cache A kernel-mode stack for every thread in every process
80000000
Kernel-mode accessible
Systemwide
FFFFFFFF
03-09-2012
10
Parts of system which are very important . This cannot be paged out.
-page pool
Program code, Data pages that had actual data written to them.
03-09-2012
11
Memory Organization
Two-level hierarchical memory map
Page directory table
Page directory entries (PDEs) point to page table One page directory table per process Location in page directory register
Page table
Page frame
address
virtual address Virtual page number Page Directory Byte within page
Page Tables
Translation Lookaside Buffer
03-09-2012
Page fault
03-09-2012
14
Page file
The page file is a hidden file called pagefile.sys. It is regenerated at each boot .
03-09-2012
15
memory, the VMM takes a block from the real memory that hasnt been
used recently, writes it to the paging file.
Then it reads the block of memory that the O.S. needs from the paging
file.
03-09-2012
16
03-09-2012
17
Page fault
When the program needs the page which is not in main
code.
03-09-2012 18
Page Faults
A page fault occurs when there is a reference to a page that isnt
The page has now been faulted into the process working set
Pages are only brought into memory as a result of page faults
03-09-2012 19
memory, then more swapping to and from the hard disk will occur as a
result.
Accessing the hard disk is far slower than using system memory. Using too many programs at once in a system with an insufficient
03-09-2012
20
newer pages
older pages
working set
Many page faults may be resolved from memory
Working Set
Each process has a default working set minimum and maximum
Can change with SetProcessWorkingSet
Working set minimum controls maximum number of locked
pages (VirtualLock)
Minimum is also reserved from RAM as a guarantee to the
process
Working set maximum is ignored
Private
Unmodified pages go to standby (clean) lists They form a system-wide cache of pages likely to be needed again
Pages can be faulted back into a process from the standby and
When free page list has 8 or more pages, a priority zero thread is awoken
to zero them
On most busy systems, this is empty too
Super Fetch
Superfetch proactively repopulates RAM with the most useful data
Sets priority of pages to optimal value, based on the page history and
Conclusion
03-09-2012
30
Thank you
03-09-2012
31