SlideShare a Scribd company logo
1 of 29
1
2
⚫ Introduction towindows os
⚫ Virtual memory
⚫ Virtual address translation
⚫ Page files / page faults
⚫ Working set
⚫ Physical memory
⚫ Conclusion
3
⚫ Microsoft Windows is a series of graphical interface operating systems
developed, marketed, and sold by Microsoft.
⚫ Microsoft Windows came to dominate the world's personal computer
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 mostrecentversionof Windows is Windows 11.
⚫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.
4
Introduction to windows OS (Cont.)
⚫CPU can address up to 3GB of memory, using its full 32 bits.
⚫This is normally far more than the RAM of the machine.
⚫The hardware provides for programs to operate in terms of as
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).
5
6
⚫The first is to allow the use of programs that are too big to
physically fit in memory.
⚫The other reason is to allow for multitasking – multiple programs
running at once.
7
⚫ In Windows the processor manages the mapping in terms of pages of 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 use need to
be held in physical RAM.
⚫ Otherparts are then held in a swap file(in as it’s called in Windows 95/98/ME:
Win386.swp )or page file(in Windows NT versions including Windows 2000 and
XP).
8
32 bit Address Space
32-bits = 2^32 = 4 GB
⚫ 3 GB foraddress space
⚫ 1 GB for kernel mode
64-bit Addressspace
64-bits = 2^64 = 17,179,869,184 GB
⚫ x64 todaysupports 48 bitsvirtual = 262,144 GB = 256 TB
⚫ IA-64 todaysupport 50 bitsvirtual = 1,048,576 GB = 1024 TB
⚫ 64-bit Windowssupports 44 bits = 16,384 GB = 16 TB
9
⚫Process space contains:
⚫ Theapplicationyou are running
(.EXE + .DLLs)
⚫ A user-modestack foreach thread
⚫ All staticstoragedefined by the
application
User
Accessible
Kernel-mode
accessible
00000000
Unique per
process
7FFFFFFF
80000000
System-
wide
FFFFFFFF
10
⚫System space contains:
⚫ Executive, Kernel
⚫ Statically-allocated system-
widedatacells
⚫ Page tables
⚫ Kernel-modedevicedrivers
⚫ Filesystem cache
⚫ A kernel-mode stack
forevery thread
in every
process
User
Accessible
Kernel-mode
accessible
00000000
Unique per
process
7FFFFFFF
80000000
System-
wide
FFFFFFFF
11
Itemsof RAM can bedivided into two parts :
-Non paged area
‱ Partsof system which arevery important . This cannot
be paged out.
-pagepool
‱ Programcode, Data pages that had actual datawritten
to them.
12
⚫ Two-level hierarchical memory map
⚫ Pagedirectory table
⚫ Pagedirectoryentries (PDEs) point to page table
⚫ One page directory table per process
⚫ Location in page directoryregister
⚫ Page table
⚫ Page table entries (PTEs) point topage frames
⚫ Page frame
⚫ Contains page of data
⚫ TLB (translation look aside buffer) acceleratesaddress translation
13
⚫ Hardwareconvertseachvalid virtual address toa physical
address
Virtual page number Byte within page
Byte within page
Physical page number
Page
Tables
Translation
Lookaside
Buffer
Page
Directory
virtual address
physical address
Address translation
(hardware) If page
not valid
Page
fault
⚫Page file
⚫ The page file is a hidden file called pagefile.sys.
⚫ It is regeneratedateach boot .
⚫ there is no need to include it in a backup
14
15
⚫ TheVMM creates a file on the hard disk that holds theextra memory that
is needed by the O.S.
⚫ This file is called a paging file (also known as a swap file), and plays an
important role in virtual memory.
⚫ The paging file combined with the RAM accounts forall of the memory.
⚫ Whenever the O.S. needsa ‘block’ of memory that’s not in the real (RAM)
memory, the VMM takes a block from the real memory that hasn’t 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.
16
⚫ TheVMM then takes the block of memory from the paging file, and
moves it into the real memory – in place of theold block.
⚫ Thisprocess iscalled swapping (also known as paging),
⚫ The blocksof memory thatare swapped arecalled pages.
17
⚫When the program needs the page which is not in main
memory the page fault interruptwill be invoked.
⚫If the this is availableon disk then itwill be swapped.
⚫If it is not available due tosome hardware problems the
systemwill have ‘invalid page faulterror’.
⚫It may manifest itself as a ‘blue screen’ failurewith a STOP
code.
18
⚫ A page faultoccurswhen there is a reference toa page that isn’t
mapped toa physical page
⚫ Thesystem goes to theappropriate block in theassociated file to find
thecontentsof the page:
⚫ Physical page is allocated
⚫ Block is read intophysical page
⚫ Page tableentry is filled in
⚫ Exception is dismissed
⚫ Processorre-executes the instruction thatcaused the page fault
⚫ The page has now been “faulted into” theprocess “working set”
⚫ Pagesareonly brought into memoryas a resultof page faults
19
⚫ Virtual memorycan slowdown performance.
⚫ If the size of virtual memory is quite large in comparison to the real
memory, then moreswapping toand from the hard disk will occuras a
result.
⚫ Accessing the hard disk is farslowerthan using system memory.
⚫ Using too many programsatonce in a system with an insufficient
amountof RAM results in constantdisk swapping – also
called thrashing.
Working Set
⚫ All the physical pages “owned” by a process
⚫ E.g. the pages the process can referencewithout incurring a page fault
⚫ A process always starts with an empty working set
⚫ It then incurs page faults when referencing a page that isn’t in its
working set
⚫ Manypage faults may be resolved from memory
newerpages olderpages
⚫ Each process hasadefaultworking set minimumand maximum
⚫ Can changewith SetProcessWorkingSet
⚫ Working set minimumcontrols maximum numberof locked
pages (VirtualLock)
⚫ Minimum is also reserved from RAM asaguarantee to the
process
⚫ Working set maximum is ignored
⚫ If there’sample memory, process working set representsall the
memory it has referenced (but not freed)
Working Set
⚫ When memory managerdecides the process is large enough, it
give up pages to make room for new pages
⚫ Local page replacement policy
⚫ Means thata single process cannot take overall of physical
memory unless otherprocesses aren’tusing it
⚫ Page replacement algorithm is least recentlyaccessed
(pages areaged when available memory is low)
Tostandby
or modified
page list
⚫ Consistsof 2 types of pages:
⚫ Shareable (of which some may be shared)
⚫ Private
⚫ Fourperformancecountersavailable:
⚫ Working Set Shareable
⚫ Working Set Shared (subsetof shareable thatare currentlyshared)
⚫ Working Set Private
⚫ Working Set Size (total of WS Shareable+Private)
⚫ Note: adding this up foreach process overcountsshared pages
⚫ System keeps unassigned physical pages on oneof several lists
⚫ Free page list
⚫ Modified page list
⚫ Standbypage lists (8 as of Vista & later)
⚫ Zeropage list
⚫ Bad page list - pages that failed memory testatsystem startup
⚫ Listsare implemented byentries in the “PFN database”
⚫ Maintained as FIFO listsorqueues
⚫ Modified pages go to modified (dirty) list
⚫ Avoidswriting pages back todisk toosoon
⚫ Unmodified pages go tostandby (clean) lists
⚫ They form asystem-widecacheof “pages likely to be needed again”
⚫ Pagescan be faulted back intoa process from thestandbyand
modified page list
⚫ Thesearecounted as page faults, but notpage reads
⚫ When modified list reachescertain size, modified pagewritersystem
thread is awoken towritepages out
⚫ Also triggered when memory isovercommitted (toofew free pages)
⚫ Does not flush entire modified page list
⚫ Pages move from the modified list to thestandby list
⚫ E.g. can still be soft faulted intoaworking set
⚫ Free Page List
⚫ Used forpage reads
⚫ Private modified pages go hereon process exit
⚫ Pages contain junk in them (e.g. not zeroed)
⚫ On most busy systems, this is empty
⚫ Zero Page List
⚫ Used tosatisfy demand zeropage faults
⚫ References to private pages that have not been created yet
⚫ When free page list has 8 or more pages, a priority zero thread is awoken
tozero them
⚫ On most busy systems, this is empty too
⚫ Superfetch proactivelyrepopulates RAM with the mostuseful data
⚫ Sets priorityof pages tooptimal value, based on the page historyand
otheranalysis that itperforms
⚫ Takes intoaccountfrequencyof page usage, usageof page in context
of otherpages in memory
⚫ Scenarios SuperFetch improves include
⚫ Resume from hibernateand suspend
⚫ Fastuserswitching
⚫ Performanceafter infrequentor low prioritytasks execute
⚫ Application launch
29

More Related Content

Similar to windows memory management.pptx

Memory virtualization
Memory virtualizationMemory virtualization
Memory virtualization
Piyush Rochwani
 
Inverted page tables basic
Inverted page tables basicInverted page tables basic
Inverted page tables basic
Sanoj Kumar
 

Similar to windows memory management.pptx (20)

Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858
 
Virtual memoryfinal
Virtual memoryfinalVirtual memoryfinal
Virtual memoryfinal
 
Mca ii os u-4 memory management
Mca  ii  os u-4 memory managementMca  ii  os u-4 memory management
Mca ii os u-4 memory management
 
VirutualMemory.docx
VirutualMemory.docxVirutualMemory.docx
VirutualMemory.docx
 
Chap8 Virtual Memory. 1997-2003.ppt
Chap8 Virtual Memory. 1997-2003.pptChap8 Virtual Memory. 1997-2003.ppt
Chap8 Virtual Memory. 1997-2003.ppt
 
CH09.pdf
CH09.pdfCH09.pdf
CH09.pdf
 
Nachos 2
Nachos 2Nachos 2
Nachos 2
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Virtual memory managment
Virtual memory managmentVirtual memory managment
Virtual memory managment
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory management
 
Memory virtualization
Memory virtualizationMemory virtualization
Memory virtualization
 
CSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual MemoryCSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual Memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Ch9
Ch9Ch9
Ch9
 
Module4
Module4Module4
Module4
 
Unit 2chapter 2 memory mgmt complete
Unit 2chapter 2  memory mgmt completeUnit 2chapter 2  memory mgmt complete
Unit 2chapter 2 memory mgmt complete
 
Inverted page tables basic
Inverted page tables basicInverted page tables basic
Inverted page tables basic
 
Improving application performance through swap compression
Improving application performance through swap compression Improving application performance through swap compression
Improving application performance through swap compression
 
ch9_virMem.pdf
ch9_virMem.pdfch9_virMem.pdf
ch9_virMem.pdf
 
Vmfs
VmfsVmfs
Vmfs
 

More from GevitaChinnaiah

More from GevitaChinnaiah (15)

Software Programming with Python II.pptx
Software Programming with Python II.pptxSoftware Programming with Python II.pptx
Software Programming with Python II.pptx
 
a basic java programming and data type.ppt
a basic java programming and data type.ppta basic java programming and data type.ppt
a basic java programming and data type.ppt
 
Install an Operating System.pptx
Install an Operating System.pptxInstall an Operating System.pptx
Install an Operating System.pptx
 
Solve Stop Code Memory Management on Windows.pptx
Solve Stop Code Memory Management on Windows.pptxSolve Stop Code Memory Management on Windows.pptx
Solve Stop Code Memory Management on Windows.pptx
 
Introduction to Database Management.pptx
Introduction to Database Management.pptxIntroduction to Database Management.pptx
Introduction to Database Management.pptx
 
OPERATING SYSTEM CHAPTER 3.ppt
OPERATING SYSTEM CHAPTER 3.pptOPERATING SYSTEM CHAPTER 3.ppt
OPERATING SYSTEM CHAPTER 3.ppt
 
Lecture 3 React Native with Database.pptx
Lecture 3 React Native with Database.pptxLecture 3 React Native with Database.pptx
Lecture 3 React Native with Database.pptx
 
Database Management System (DBMS).pptx
Database Management System (DBMS).pptxDatabase Management System (DBMS).pptx
Database Management System (DBMS).pptx
 
Operating System chapter 1.pptx
Operating System chapter 1.pptxOperating System chapter 1.pptx
Operating System chapter 1.pptx
 
Lecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptxLecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptx
 
Lecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptxLecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptx
 
Understanding Applications.pptx
Understanding Applications.pptxUnderstanding Applications.pptx
Understanding Applications.pptx
 
Operating System 2.pptx
Operating System 2.pptxOperating System 2.pptx
Operating System 2.pptx
 
Operating System 1.pptx
Operating System 1.pptxOperating System 1.pptx
Operating System 1.pptx
 
INTRODUCTION TO DATABASE AND QUERING.pptx
INTRODUCTION TO DATABASE AND QUERING.pptxINTRODUCTION TO DATABASE AND QUERING.pptx
INTRODUCTION TO DATABASE AND QUERING.pptx
 

Recently uploaded

Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
JoseMangaJr1
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 JustđŸ“Č Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 JustđŸ“Č Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 JustđŸ“Č Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 JustđŸ“Č Call Ruhi Call Girl Phone No Amri...
karishmasinghjnh
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
amitlee9823
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
amitlee9823
 
âž„đŸ” 7737669865 đŸ”â–» Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
âž„đŸ” 7737669865 đŸ”â–» Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...âž„đŸ” 7737669865 đŸ”â–» Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
âž„đŸ” 7737669865 đŸ”â–» Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
amitlee9823
 
Call Girls In Nandini Layout ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 đŸ„” Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 đŸ„” Book Your One night Stand
amitlee9823
 
Call Girls In Doddaballapur Road ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 đŸ„” Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 đŸ„” Book Your One night Stand
amitlee9823
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Call Girls In Attibele ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 đŸ„” Book Your One night StandCall Girls In Attibele ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 đŸ„” Book Your One night Stand
amitlee9823
 
Call Girls In Hsr Layout ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 đŸ„” Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 đŸ„” Book Your One night Stand
amitlee9823
 
âž„đŸ” 7737669865 đŸ”â–» malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
âž„đŸ” 7737669865 đŸ”â–» malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...âž„đŸ” 7737669865 đŸ”â–» malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
âž„đŸ” 7737669865 đŸ”â–» malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
amitlee9823
 
âž„đŸ” 7737669865 đŸ”â–» Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
âž„đŸ” 7737669865 đŸ”â–» Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...âž„đŸ” 7737669865 đŸ”â–» Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
âž„đŸ” 7737669865 đŸ”â–» Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
amitlee9823
 

Recently uploaded (20)

Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 JustđŸ“Č Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 JustđŸ“Č Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 JustđŸ“Č Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 JustđŸ“Č Call Ruhi Call Girl Phone No Amri...
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
âž„đŸ” 7737669865 đŸ”â–» Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
âž„đŸ” 7737669865 đŸ”â–» Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...âž„đŸ” 7737669865 đŸ”â–» Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
âž„đŸ” 7737669865 đŸ”â–» Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Call Girls In Nandini Layout ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 đŸ„” Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 đŸ„” Book Your One night Stand
 
Call Girls In Doddaballapur Road ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 đŸ„” Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 đŸ„” Book Your One night Stand
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
Detecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachDetecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning Approach
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Call Girls In Attibele ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 đŸ„” Book Your One night StandCall Girls In Attibele ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 đŸ„” Book Your One night Stand
 
Call Girls In Hsr Layout ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 đŸ„” Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 đŸ„” Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 đŸ„” Book Your One night Stand
 
âž„đŸ” 7737669865 đŸ”â–» malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
âž„đŸ” 7737669865 đŸ”â–» malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...âž„đŸ” 7737669865 đŸ”â–» malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
âž„đŸ” 7737669865 đŸ”â–» malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
âž„đŸ” 7737669865 đŸ”â–» Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
âž„đŸ” 7737669865 đŸ”â–» Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...âž„đŸ” 7737669865 đŸ”â–» Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
âž„đŸ” 7737669865 đŸ”â–» Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
 

windows memory management.pptx

  • 1. 1
  • 2. 2 ⚫ Introduction towindows os ⚫ Virtual memory ⚫ Virtual address translation ⚫ Page files / page faults ⚫ Working set ⚫ Physical memory ⚫ Conclusion
  • 3. 3 ⚫ Microsoft Windows is a series of graphical interface operating systems developed, marketed, and sold by Microsoft. ⚫ Microsoft Windows came to dominate the world's personal computer 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 mostrecentversionof Windows is Windows 11.
  • 4. ⚫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. 4 Introduction to windows OS (Cont.)
  • 5. ⚫CPU can address up to 3GB of memory, using its full 32 bits. ⚫This is normally far more than the RAM of the machine. ⚫The hardware provides for programs to operate in terms of as 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). 5
  • 6. 6 ⚫The first is to allow the use of programs that are too big to physically fit in memory. ⚫The other reason is to allow for multitasking – multiple programs running at once.
  • 7. 7 ⚫ In Windows the processor manages the mapping in terms of pages of 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 use need to be held in physical RAM. ⚫ Otherparts are then held in a swap file(in as it’s called in Windows 95/98/ME: Win386.swp )or page file(in Windows NT versions including Windows 2000 and XP).
  • 8. 8 32 bit Address Space 32-bits = 2^32 = 4 GB ⚫ 3 GB foraddress space ⚫ 1 GB for kernel mode 64-bit Addressspace 64-bits = 2^64 = 17,179,869,184 GB ⚫ x64 todaysupports 48 bitsvirtual = 262,144 GB = 256 TB ⚫ IA-64 todaysupport 50 bitsvirtual = 1,048,576 GB = 1024 TB ⚫ 64-bit Windowssupports 44 bits = 16,384 GB = 16 TB
  • 9. 9 ⚫Process space contains: ⚫ Theapplicationyou are running (.EXE + .DLLs) ⚫ A user-modestack foreach thread ⚫ All staticstoragedefined by the application User Accessible Kernel-mode accessible 00000000 Unique per process 7FFFFFFF 80000000 System- wide FFFFFFFF
  • 10. 10 ⚫System space contains: ⚫ Executive, Kernel ⚫ Statically-allocated system- widedatacells ⚫ Page tables ⚫ Kernel-modedevicedrivers ⚫ Filesystem cache ⚫ A kernel-mode stack forevery thread in every process User Accessible Kernel-mode accessible 00000000 Unique per process 7FFFFFFF 80000000 System- wide FFFFFFFF
  • 11. 11 Itemsof RAM can bedivided into two parts : -Non paged area ‱ Partsof system which arevery important . This cannot be paged out. -pagepool ‱ Programcode, Data pages that had actual datawritten to them.
  • 12. 12 ⚫ Two-level hierarchical memory map ⚫ Pagedirectory table ⚫ Pagedirectoryentries (PDEs) point to page table ⚫ One page directory table per process ⚫ Location in page directoryregister ⚫ Page table ⚫ Page table entries (PTEs) point topage frames ⚫ Page frame ⚫ Contains page of data ⚫ TLB (translation look aside buffer) acceleratesaddress translation
  • 13. 13 ⚫ Hardwareconvertseachvalid virtual address toa physical address Virtual page number Byte within page Byte within page Physical page number Page Tables Translation Lookaside Buffer Page Directory virtual address physical address Address translation (hardware) If page not valid Page fault
  • 14. ⚫Page file ⚫ The page file is a hidden file called pagefile.sys. ⚫ It is regeneratedateach boot . ⚫ there is no need to include it in a backup 14
  • 15. 15 ⚫ TheVMM creates a file on the hard disk that holds theextra memory that is needed by the O.S. ⚫ This file is called a paging file (also known as a swap file), and plays an important role in virtual memory. ⚫ The paging file combined with the RAM accounts forall of the memory. ⚫ Whenever the O.S. needsa ‘block’ of memory that’s not in the real (RAM) memory, the VMM takes a block from the real memory that hasn’t 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.
  • 16. 16 ⚫ TheVMM then takes the block of memory from the paging file, and moves it into the real memory – in place of theold block. ⚫ Thisprocess iscalled swapping (also known as paging), ⚫ The blocksof memory thatare swapped arecalled pages.
  • 17. 17 ⚫When the program needs the page which is not in main memory the page fault interruptwill be invoked. ⚫If the this is availableon disk then itwill be swapped. ⚫If it is not available due tosome hardware problems the systemwill have ‘invalid page faulterror’. ⚫It may manifest itself as a ‘blue screen’ failurewith a STOP code.
  • 18. 18 ⚫ A page faultoccurswhen there is a reference toa page that isn’t mapped toa physical page ⚫ Thesystem goes to theappropriate block in theassociated file to find thecontentsof the page: ⚫ Physical page is allocated ⚫ Block is read intophysical page ⚫ Page tableentry is filled in ⚫ Exception is dismissed ⚫ Processorre-executes the instruction thatcaused the page fault ⚫ The page has now been “faulted into” theprocess “working set” ⚫ Pagesareonly brought into memoryas a resultof page faults
  • 19. 19 ⚫ Virtual memorycan slowdown performance. ⚫ If the size of virtual memory is quite large in comparison to the real memory, then moreswapping toand from the hard disk will occuras a result. ⚫ Accessing the hard disk is farslowerthan using system memory. ⚫ Using too many programsatonce in a system with an insufficient amountof RAM results in constantdisk swapping – also called thrashing.
  • 20. Working Set ⚫ All the physical pages “owned” by a process ⚫ E.g. the pages the process can referencewithout incurring a page fault ⚫ A process always starts with an empty working set ⚫ It then incurs page faults when referencing a page that isn’t in its working set ⚫ Manypage faults may be resolved from memory newerpages olderpages
  • 21. ⚫ Each process hasadefaultworking set minimumand maximum ⚫ Can changewith SetProcessWorkingSet ⚫ Working set minimumcontrols maximum numberof locked pages (VirtualLock) ⚫ Minimum is also reserved from RAM asaguarantee to the process ⚫ Working set maximum is ignored ⚫ If there’sample memory, process working set representsall the memory it has referenced (but not freed)
  • 22. Working Set ⚫ When memory managerdecides the process is large enough, it give up pages to make room for new pages ⚫ Local page replacement policy ⚫ Means thata single process cannot take overall of physical memory unless otherprocesses aren’tusing it ⚫ Page replacement algorithm is least recentlyaccessed (pages areaged when available memory is low) Tostandby or modified page list
  • 23. ⚫ Consistsof 2 types of pages: ⚫ Shareable (of which some may be shared) ⚫ Private ⚫ Fourperformancecountersavailable: ⚫ Working Set Shareable ⚫ Working Set Shared (subsetof shareable thatare currentlyshared) ⚫ Working Set Private ⚫ Working Set Size (total of WS Shareable+Private) ⚫ Note: adding this up foreach process overcountsshared pages
  • 24. ⚫ System keeps unassigned physical pages on oneof several lists ⚫ Free page list ⚫ Modified page list ⚫ Standbypage lists (8 as of Vista & later) ⚫ Zeropage list ⚫ Bad page list - pages that failed memory testatsystem startup ⚫ Listsare implemented byentries in the “PFN database” ⚫ Maintained as FIFO listsorqueues
  • 25. ⚫ Modified pages go to modified (dirty) list ⚫ Avoidswriting pages back todisk toosoon ⚫ Unmodified pages go tostandby (clean) lists ⚫ They form asystem-widecacheof “pages likely to be needed again” ⚫ Pagescan be faulted back intoa process from thestandbyand modified page list ⚫ Thesearecounted as page faults, but notpage reads
  • 26. ⚫ When modified list reachescertain size, modified pagewritersystem thread is awoken towritepages out ⚫ Also triggered when memory isovercommitted (toofew free pages) ⚫ Does not flush entire modified page list ⚫ Pages move from the modified list to thestandby list ⚫ E.g. can still be soft faulted intoaworking set
  • 27. ⚫ Free Page List ⚫ Used forpage reads ⚫ Private modified pages go hereon process exit ⚫ Pages contain junk in them (e.g. not zeroed) ⚫ On most busy systems, this is empty ⚫ Zero Page List ⚫ Used tosatisfy demand zeropage faults ⚫ References to private pages that have not been created yet ⚫ When free page list has 8 or more pages, a priority zero thread is awoken tozero them ⚫ On most busy systems, this is empty too
  • 28. ⚫ Superfetch proactivelyrepopulates RAM with the mostuseful data ⚫ Sets priorityof pages tooptimal value, based on the page historyand otheranalysis that itperforms ⚫ Takes intoaccountfrequencyof page usage, usageof page in context of otherpages in memory ⚫ Scenarios SuperFetch improves include ⚫ Resume from hibernateand suspend ⚫ Fastuserswitching ⚫ Performanceafter infrequentor low prioritytasks execute ⚫ Application launch
  • 29. 29