What is paged memory in windows

What are page and swap files and how big should they be?

By Tom Li 25 March 2018

How to change your virtual memory settings in Windows.

While you probably don’t need to adjust your PC’s page and swap files, it’s useful to know what they are when troubleshooting, or if you’re trying to free up a little hard drive space.

What is a page file?

A page file acts like a physical extension of RAM and is used to offload excess or idle data from the memory to the hard disk. It’s necessary because if the main system RAM is overloaded and no page space is available, a program could crash and potentially lose data.

What is a swap file?

The swap file and the page file perform essentially the same function. Swap files are also a reserved section of disk space that’s used for offloading data from RAM. One of the swap file’s primary functions is to provide a page space for Windows Apps from the Windows Store. When a Windows app enters idle mode, it’s unloaded into the swap file until the user activates it again. This frees up some memory for more important tasks that are currently running.

The swap file co-exists alongside the page file and is much smaller in size, taking up only a few hundred megabytes of space at most. It sits silently in the background and requires no intervention from the user. If you want to check the size of your swap file, it’s listed as swafile.sys in the Windows file tree.

Besides using only a small portion of your disk space, the swap file does not impact performance as long as it’s not being accessed constantly (nor does the page file, for that matter). This typically happens when the system is depleted of actual RAM. If this is happening to you, consider installing more RAM.

On the other hand, if you have oodles of RAM but are desperate for storage space, you can choose to shrink the size of your page file. Below are instructions for changing your page file, and how big it should be.

How do I change the size of my page file?

To change the size of your page file, navigate to the ‘System’ section of the Windows Control Panel. Open ‘Advanced System Settings’ and navigate to the ‘Advanced’ tab. Click the ‘Settings’ button under the ‘Performance’ section to open another window. Click on the new window’s ‘Advanced’ tab, and click ‘Change’ under the ‘Virtual Memory’ section.

There isn’t a way to directly adjust the size of the swap file. If you have a page file enabled on your machine, which you should by default, then Windows will dynamically adjust its size for you.

How big should my page file be?

Initially, Windows will configure a page file size based on the amount of memory installed and free disk space available. If you don’t run memory intensive applications (such as virtual machines and production software) other than games, you can shrink the page file down to a fraction of your total available RAM.

Personally, I have my page file configured to 2GB on a system with 16GB RAM without any issues. For users with 8GB RAM or below, I would recommend keeping the default page size.

Читайте также:  Windows image acquisition wia windows 10 как включить

You can also choose to disable paging completely, thus maximizing your space savings. I would strongly recommend against this as it could make your system and programs crash when you unexpectedly run out of RAM. Certain critical functions in older versions of Windows, such as a complete memory dump, would not even run with the page file disabled.

How To Manage Virtual Memory (Pagefile) In Windows 10

This tutorial was written by Tom’s Hardware Community member viveknayyar007. You can find a list of all their tutorials here.

Pagefile in Windows 10 is a hidden system file with the .SYS extension that is stored on your computer’s system drive (usually C:\). The Pagefile allows the computer to perform smoothly by reducing the workload of the physical memory, or RAM.

Simply put, every time you open more applications than the RAM on your PC can accommodate, the programs already present in the RAM are automatically transferred to the Pagefile. This process is technically called Paging. Because the Pagefile works as a secondary RAM, many times it is also referred to as Virtual Memory.

The minimum and maximum size of the Pagefile can be up to 1.5 times and 4 times of the physical memory that your computer has, respectively. For example, if your computer has 1GB of RAM, the minimum Pagefile size can be 1.5GB, and the maximum size of the file can be 4GB.

By default, Windows 10 automatically manages the Pagefile according to your computer’s configuration and the RAM present in it. However, if you ever face lagging while working on Windows 10, or you start getting the PAGE_FAULT_IN_NONPAGED_AREA or KERNEL_DATA_INPAGE_ERROR Blue Screen of Death (BSOD), managing the size of the Pagefile manually is the first thing you should look for.

Managing the Pagefile size manually in Windows 10 is simple. Here is how:

  • Use an administrator account to log on to Windows 10.
  • From the desktop screen, right-click the Start button to open its context menu.

What’s non-paged pool memory?

Replies (5) 

The nonpaged pool consists of virtual memory addresses that are guaranteed to reside in physical memory as long as the corresponding kernel objects are allocated. The paged pool consists of virtual memory that can be paged in and out of the system. To improve performance, systems with a single processor have three paged pools, and multiprocessor systems have five paged pools.

Hope this helps.

9 people found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Where can i find the three paged pools?

What do you mean paged in and out ?

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Where can i find the three paged pools?

What do you mean paged in and out ?

When a machine boots up, the Memory Manager creates two dynamically sized memory pools that kernel-mode components use to allocate system memory. These two pools are known as the Paged Pool and NonPaged Pool. Each of these pools start at an initial size that is based upon the amount of physical memory present in the system. Pool memory is a subset of available memory and is not necessarily contiguous. If necessary, these pools can grow up to a maximum size that is determined by the system at boot time.

Читайте также:  John the ripper для linux

The first difference is that Paged Pool is exactly what its name implies — it can be paged out. Meaning it can be lowered

The NonPaged Pool cannot be paged out. Drivers use the NonPaged Pool for many of their requirements because they can be accessed at any Interrupt Request Level (IRQL).

Memory Management — Understanding Pool Resources

Virtual Memory in OS: What is, Demand Paging, Advantages

What is Virtual Memory?

Virtual Memory is a storage mechanism which offers user an illusion of having a very big main memory. It is done by treating a part of secondary memory as the main memory. In Virtual memory, the user can store processes with a bigger size than the available main memory.

Therefore, instead of loading one long process in the main memory, the OS loads the various parts of more than one process in the main memory. Virtual memory is mostly implemented with demand paging and demand segmentation.

Why Need Virtual Memory?

Here, are reasons for using virtual memory:

  • Whenever your computer doesn’t have space in the physical memory it writes what it needs to remember to the hard disk in a swap file as virtual memory.
  • If a computer running Windows needs more memory/RAM, then installed in the system, it uses a small portion of the hard drive for this purpose.

How Virtual Memory Works?

In the modern world, virtual memory has become quite common these days. It is used whenever some pages require to be loaded in the main memory for the execution, and the memory is not available for those many pages.

So, in that case, instead of preventing pages from entering in the main memory, the OS searches for the RAM space that are minimum used in the recent times or that are not referenced into the secondary memory to make the space for the new pages in the main memory.

Let’s understand virtual memory management with the help of one example.

For example:

Let’s assume that an OS requires 300 MB of memory to store all the running programs. However, there’s currently only 50 MB of available physical memory stored on the RAM.

  • The OS will then set up 250 MB of virtual memory and use a program called the Virtual Memory Manager(VMM) to manage that 250 MB.
  • So, in this case, the VMM will create a file on the hard disk that is 250 MB in size to store extra memory that is required.
  • The OS will now proceed to address memory as it considers 300 MB of real memory stored in the RAM, even if only 50 MB space is available.
  • It is the job of the VMM to manage 300 MB memory even if just 50 MB of real memory space is available.

What is Demand Paging?

A demand paging mechanism is very much similar to a paging system with swapping where processes stored in the secondary memory and pages are loaded only on demand, not in advance.

So, when a context switch occurs, the OS never copy any of the old program’s pages from the disk or any of the new program’s pages into the main memory. Instead, it will start executing the new program after loading the first page and fetches the program’s pages, which are referenced.

During the program execution, if the program references a page that may not be available in the main memory because it was swapped, then the processor considers it as an invalid memory reference. That’s because the page fault and transfers send control back from the program to the OS, which demands to store page back into the memory.

Types of Page Replacement Methods

Here, are some important Page replacement methods

  • FIFO
  • Optimal Algorithm
  • LRU Page Replacement
Читайте также:  Лучшие ssh клиенты для windows

FIFO Page Replacement

FIFO (First-in-first-out) is a simple implementation method. In this method, memory selects the page for a replacement that has been in the virtual address of the memory for the longest time.

Features:

  • Whenever a new page loaded, the page recently comes in the memory is removed. So, it is easy to decide which page requires to be removed as its identification number is always at the FIFO stack.
  • The oldest page in the main memory is one that should be selected for replacement first.

Optimal Algorithm

The optimal page replacement method selects that page for a replacement for which the time to the next reference is the longest.

Features:

  • Optimal algorithm results in the fewest number of page faults. This algorithm is difficult to implement.
  • An optimal page-replacement algorithm method has the lowest page-fault rate of all algorithms. This algorithm exists and which should be called MIN or OPT.
  • Replace the page which unlike to use for a longer period of time. It only uses the time when a page needs to be used.

LRU Page Replacement

The full form of LRU is the Least Recently Used page. This method helps OS to find page usage over a short period of time. This algorithm should be implemented by associating a counter with an even- page.

How does it work?

  • Page, which has not been used for the longest time in the main memory, is the one that will be selected for replacement.
  • Easy to implement, keep a list, replace pages by looking back into time.

Features:

  • The LRU replacement method has the highest count. This counter is also called aging registers, which specify their age and how much their associated pages should also be referenced.
  • The page which hasn’t been used for the longest time in the main memory is the one that should be selected for replacement.
  • It also keeps a list and replaces pages by looking back into time.

Fault rate

Fault rate is a frequency with which a designed system or component fails. It is expressed in failures per unit of time. It is denoted by the Greek letter ? (lambda).

Advantages of Virtual Memory

Here, are pros/benefits of using Virtual Memory:

  • Virtual memory helps to gain speed when only a particular segment of the program is required for the execution of the program.
  • It is very helpful in implementing a multiprogramming environment.
  • It allows you to run more applications at once.
  • It helps you to fit many large programs into smaller programs.
  • Common data or code may be shared between memory.
  • Process may become even larger than all of the physical memory.
  • Data / code should be read from disk whenever required.
  • The code can be placed anywhere in physical memory without requiring relocation.
  • More processes should be maintained in the main memory, which increases the effective use of CPU.
  • Each page is stored on a disk until it is required after that, it will be removed.
  • It allows more applications to be run at the same time.
  • There is no specific limit on the degree of multiprogramming.
  • Large programs should be written, as virtual address space available is more compared to physical memory.

Disadvantages of Virtual Memory

Here, are drawbacks/cons of using virtual memory:

  • Applications may run slower if the system is using virtual memory.
  • Likely takes more time to switch between applications.
  • Offers lesser hard drive space for your use.
  • It reduces system stability.
  • It allows larger applications to run in systems that don’t offer enough physical RAM alone to run them.
  • It doesn’t offer the same performance as RAM.
  • It negatively affects the overall performance of a system.
  • Occupy the storage space, which may be used otherwise for long term data storage.
Оцените статью