Memory Paging
1/18
This material was developed with funding from the
National Science Foundation under Grant # DUE 1601612
Next
Restart
Back
2/18
Memory Paging
Main memory or random access memory (RAM) is the physical hardware component installed in your computer. Main memory holds the operating system, applications, documents and data while you are working with them. The central processing unit (CPU), the brain of the computer, works closely with main memory. The CPU gets data and instructions from the main memory to perform tasks. Main memory is very fast but there is a limit to how much RAM you can install in a system.
3/18
As users open and use multiple applications and files on a computer there is typically not enough room in main memory for all the information that the CPU needs. Therefore, the computer must swap the content of main memory into something called virtual memory. Virtual memory is reserved space on the system’s hard disk which can temporarily hold pages of information from RAM. This reserved space is referred to as a swap or page file (Windows uses pagefile.sys as the name of the file).
Page Table
Memory Mapping
Virtual Addresses
Your system has 4 GB of RAM installed. The installed RAM determines the Physical Address space. The operating system will use the page file on the hard disk to make up the difference between the virtual address requirements and the available physical addresses. With Virtual Memory, the virtual addresses map to RAM addresses initially. When all the RAM addresses are taken, the remaining virtual addresses get mapped to the page file on the disk.
4 GB
Physical Addresses
8 GB
5/18
OS determines requirements and sets up virtual addresses
4GB RAM
1010100010
...
More RAM Needed
The content in RAM is divided into equal fixed-block sizes called page frames or frames. When you are working on a document in Word, the processes for that program occupy the frames in RAM. When you want to switch to Photoshop to edit a graphic file, there is not enough physical address space for both programs. Therefore, the program data for Word needs to be move out of RAM.
4kB
4GB Virtual Memory File
Memory Manager
Initial Size 4GB
6/18
Max
Size 12GB
Filling
You may remember, though, that reading from RAM is faster than reading from the hard drive. If your system does not have enough RAM, there will be an excess of paging as programs and data are frequently swapped between the main memory and the page file on the hard drive. In this case, you need to run fewer programs concurrently or install additional RAM.
14/18
In Windows, the operating system uses a default page file based on the amount of physical RAM installed:If less than 1 GB of RAM is installed, the initial size will be 1.5 times the amount of installed RAM and the maximum size will be three times the installed RAM.If there is more than 1 GB of RAM installed, the initial size will be equal to the amount of RAM installed. The maximum size will be three times the installed RAM.If you have a 32-bit system, the maximum size of the page file will be 4 GB.
8/18
Crash Dump
a file created for debugging in Windows when portions of the processor’s data or RAM memory are copied to one or more files.
9/18
Close
If you want to use custom settings, how should you size your page file? The old rule of thumb that suggests multiplying your installed RAM by 1.5 or 2 does not make sense in newer systems that have 16, 32 or even 128 GB of RAM installed. To properly size your page file, consider the memory needs of the applications that you are running in addition to the crash dump settings.
10/18
To determine how much memory your application needs, establish a baseline in Performance Monitor (Perfmon). Go to Data Collector Sets > right click on User Defined > New, Data Collector Set. Name the new set and select the Create manually radio button. Add the following counters:Memory > Committed Bytes: amount of committed virtual memory (in bytes)Memory > Committed Limit: amount of virtual memory that can be committed without having to extend the paging fileMemory > % Committed Bytes In Use: ratio of Committed Bytes to Commit LimitCollect the information for at least one week.
Performance Monitor
a Windows tool used to view and analyze performance based on application and hardware data
11/18
The page file size formula should be the maximum value of Committed Bytes + 20% buffer to accommodate workload fluctuations – RAM size. If your system has 16 GB of RAM and the maximum of Committed Bytes was 20 GB, the recommended page file will be 20 x 1.2 – 16 which equals 8 GB.
What about the page file size needed to record information when the system crashes? There are three types of memory dumps:Complete memory dump requires installed RAM + 257 MBKernel memory dump requires 2 GB on a 32-bit system and up to 8 TB on a 64-bit systemSmall memory dump requires 64 KB – 512 KBUse the Kernel Memory Dump for analysis since the Complete Memory Dump is only required in special cases. On systems with up to 256 GB RAM, use 8-12 GB for the Kernel Memory dump. On systems with up to 1.5 TB or RAM, use 8-32 GB for the Kernel Memory Dump.
Small Memory Dump
includes the process information and kernel context for the process that crashed and is only 64 KB in size
Complete Memory Dump
includes all the physical memory that is used by Windows
12/18
Kernel Memory Dump
includes all the memory allocated to the Windows kernel and hardware abstraction layer (HAL). A kernel manages the operations of the computer and the hardware
Now that you have determined the proper page file parameters, you can make the changes to the Virtual Memory initial size and maximum size. In Control Panel, select
System > Advanced system settings > Performance Settings > Advanced tab > Change button. You will notice that the box to have Windows automatically manage paging file size is selected. Remove the checkmark and select the Custom size radio button to enter your custom settings.
13/18
16 GB of RAM and the maximum of Committed Bytes was 20 GB
20 x 1.2 – 16 = 8 GB
Expanding
A process called paging is used to move page frames from RAM to the page file on the hard disk. These pages will be swapped back to RAM when you switch back to using Word. An example page size is four kilobytes. The memory manager can increase the size of the page file if needed. The memory manager uses two settings:Initial Virtual Memory Size (equal to RAM installed)Maximum Virtual Memory Size
7/18
Say you need to have both Word and Photoshop open on your system. The operating system determines that it needs 8 GB of memory for all the programs running, and it assigns virtual addresses. Virtual Addresses are what the program uses.
4/18
Take A Quiz
15/18
Now that you have reviewed Memory Paging, click “Next” to test your knowledge.
You have 2 GB of RAM installed in your system. You are letting Windows determine the default page file.
Drag and drop the correct memory size to the corresponding spaces.
What is the recommended Maximum Virtual Memory size?
4 GB
Drag and drop the correct answer here
17/18
3 GB
Take a Quiz
Note for Jasmine When the correct item is dropped please show
“checkmark” over the drop box
Could they also hear the sound “confirmation2.mp3"
Great Job!
1 GB
2 GB
6 GB
Note for Jasmine When the all correct items are dropped please show
“final feedback”
Could they also hear the sound “confirmation2.mp3"
What is the recommended Initial Virtual Memory size?
Note for Jasmine The correct answers are
Initial Size = 2GB
Maximum Size = 6 GB
5 GB
Drag each term to its appropriate description.
Fixed-block size of virtual addresses
Note for Jasmine When the all terms are dropped please show
“final feedback”
Could they also hear the sound “confirmation2.mp3"
Equal fixed-block sizes of physical addresses in RAM
Page
Note for Jasmine When the correct term is dropped please show
“checkmark” over the drop box
Could they also hear the sound “confirmation2.mp3"
Frame
Element
with Audio
HTML
16/18
6.4 GB
1.6 GB
Committed Bytes + 20% - RAM
You currently have 24 GB of RAM installed. You ran Performance Monitor for a week and obtained the following results:
Committed Bytes: 28 GB
Committed Limit: 32 GB
Committed Bytes in Use: 87.5%
What is the recommended page file size?
Click to choose the correct answer.
9.6 GB
18/18