Memory Usage and the Paging File
Memory Usage and the Paging File
When your computer does not have enough memory to perform all of its functions, Windows and your programs can stop working. To help prevent data loss, Windows notifies you when your computer is low on memory. Other signs of low memory include poor performance and screen problems. You can also check the Event Viewer and the Windows Reliability and Performance Monitor.
Your computer has two types of memory: random access memory (RAM), also known as physical memory, and virtual memory, also known as a paging file. All programs use RAM, but when there is not enough RAM for the program you’re trying to run, Windows temporarily moves information that is normal- ly stored in RAM to the virtual memory.
Virtual memory is disk space that acts like RAM, which enables the operating system to load more programs and data. Parts of all the programs and data to
Windows Performance Monitoring Tools
be accessed are constantly swapped back and forth between RAM and disk so the virtual memory looks and acts like regular RAM. This is beneficial to the user because disk memory is far cheaper than RAM.
The RAM and virtual memory are broken down into chunks called pages, which are monitored by the operating system. When the RAM becomes full, the virtual memory system copies the least recently used programs and data to the virtual memory. Because this frees part of the RAM, it then has room to copy something else from virtual memory, load another program, or load more data. Windows 7 calls its virtual memory a paging file.
If you have low memory, you should consider the following: . Installing more memory . Increasing the size of the paging file . Determining if a program overuses memory
To determine how much RAM you have, you can use the Welcome Center, Task Manager, or System Information. To open System Information:
1. Click the Start button and select All Programs.
2. Select Accessories, followed by selecting System Tools.
3. Select System Information.
4. The total amount of RAM is listed under total physical memory. Windows 7 does a much better job in managing virtual memory than older
versions of Windows. Windows 7 sets the minimum size of the paging file at the amount of RAM installed on your computer plus 300 MB and the maxi- mum size at three times the amount of RAM installed on your computer. For most systems, if your paging file usage exceeds 1.5 times your RAM, your sys- tem experiences performance problems as it is paging to a slower disk more than it should.
If you want to manually manage virtual memory, you use a fixed virtual mem- ory size in most cases. To do this, set the initial size and the maximum size to the same value. This ensures that the paging file is consistent and can be writ- ten to a single contiguous file (if possible, given the amount of space on the volume).
CHAPTER 15: Optimizing Windows 7 Systems
ExamAlert
A high value for pages/sec counter in performance monitor most likely means that you are low on physical memory because pages/sec shows how often it has to access the paging file.
Manually configure virtual memory by completing the following steps:
1. Click Start and then click Control Panel.
2. In Control Panel, click the System and Security category heading link.
3. Click System.
4. Click Advanced System Settings in the left pane.
5. Click Settings in the Performance section to display the Performance Options dialog box.
6. Click the Advanced tab and then click Change to display the Virtual Memory dialog box, as shown in Figure 15.6.
7. Clear the Automatically manage paging file size for all drives checkbox.
8. Under Drive [Volume Label], click the drive that contains the paging file you want to change.
9. Click Custom size, type a new size in megabytes in the Initial size (MB) or Maximum size (MB) box, click Set, and then click OK.
FIGURE 15.6 Modifying the Windows 7 paging file.
Windows Performance Monitoring Tools
Increases in size usually do not require a restart, but if you decrease the size, you need to restart your computer for the changes to take effect. You should not disable or delete the paging file.