May 11, 2025
Trending News

What is virtual memory and what is it for?

  • October 27, 2023
  • 0

Although there are currently home computers with monstrous amounts of RAM, it does not hurt to consider and know what virtual memory, a technique used to access more

What is virtual memory and what is it for?

Although there are currently home computers with monstrous amounts of RAM, it does not hurt to consider and know what virtual memory, a technique used to access more memory than is physically available to run the operating system, applications, and other software. In general, when running out of available RAM, virtual memory is supported by the unused space of the storage unit, which can be a hard disk or an SSD.

At this point, it is no mystery to know that RAM is the memory used to support the software that runs on the computer, covering both the operating system and applications, services and other programs. As software is running on the computer, especially if what was previously open is not closed, the user may find that they are running out of RAM and the system (especially Windows) will start resorting to the storage drive to replenish it.

virtual memory covers a combination of RAM and a storage drive or swap area. A computer’s operating system uses a combination of hardware and software to map memory addresses used by a program, called virtual addresses, to physical addresses in the computer’s memory.

Although it allows you to “expand” the amount of memory to run software, it’s important to remember that storage is slower than RAM, so when virtual memory starts to do its thing, it’s normal for your computer to slow down. down, especially if you are using a mechanical hard drive.

In case you see it virtual memory is using the storage drive too often, it may be because the computer needs RAM expansion. Considering how much current applications and especially the amount of resources that web browsers take up, the minimum recommended amount of RAM for a home computer intended for basic tasks can be set to 4 GB, and with those, 8 GB would be optimal. From there we get into the specific circumstances of each.

The most basic aspects of virtual memory are easy to understand, so I’ll explain the support mechanism that Windows uses and outline the most popular options for Linux in this regard.

Virtual Memory in Windows

Virtual memory in Windows uses a paging file on a named storage unit pagefile.sys, which is hidden in the system root directory. In a very simple way, data is stored there that does not fit into the RAM memory, but is necessary for the normal functioning of the computer.

When Windows starts using the storage drive and thus the file pagefile.sysit is normal for the user to experience computer slowdown, which may be more pronounced the older the storage drive format. In other words, the slowdown will be more noticeable on a mechanical hard drive than on a PCIe SSD.

Memory monitoring in Windows

Windows has virtual memory configured by default and will take over the storage drive when your computer runs out of RAM. Although virtual memory does not offer advantages on all fronts due to the loss of performance when it starts to rely on disk, its use is important because it prevents crashes and stability problems. This can be somewhat reminiscent of the dreaded thermal throttling, a defense mechanism that reduces the performance of a hardware component to prevent it from overheating.

Do I need to reconfigure the paging file in Windows? If the computer has eight or more gigabytes of RAM, it is very rare that this question will be answered in the affirmative.However, on computers with less memory, it may be a good idea if you notice that your computer is running too fast. Of course, if you are not clear about what you are doing, it is advisable not to touch anything.

How to reconfigure virtual memory in Windows

To reconfigure the paging file in Windows, you must enter the phrase “Customize the look and performance of Windows” (without quotes) in the Start menu search box and click on the item that appears with the same phrase.

Customize the look and performance of Windows

After clicking, you will be taken to “Performance Options” where you need to click on “Advanced options“. Then you need to go to the virtual memory configuration and then click on the button “Change“.

Advanced options for reconfiguring virtual memory in Windows

Once inside, the “Automatically manage paging file size for all drives” box is unchecked and you can set your own initial and maximum size in megabytes. Here I have given a minimum of 1024 megabytes (1 GB) and a maximum of 4096 megabytes (4 GB) as an example, because these values ​​depend on the performance of the device and the needs of the user.

Other options are to let the system manage the size and leave the system without a paging file. Here I repeat what I said earlier: If you’re not sure what you’re doing, it’s best to leave the “Automatically manage paging file size for all drives” box checked. and let Windows take care of everything itself. On the other hand, it is not advisable to disable the paging file.

Virtual memory in Linux

Virtual memory in Linux is conceptually the same. A storage compartment, commonly called, is traditionally used exchangewhich is responsible for supporting the RAM when it starts to run out, although it is also possible that it is used as a cache, so the user will probably see that it has been used, even if it has far from consumed the available RAM in the team.

Recently, other formats exchangemainly through Ubuntu and Fedoratwo of the best known and most used distributions. It uses the first one by default swap filewhose operation is similar to the Windows paging file, since it consists of a file located in the root directory of the system, which is responsible for the exchange, while the other resorts to exchange about ZRAM, which consists of using a kernel module, ZRAM, which creates a compressed block device in RAM. He said rudely and so that it would be understood, exchange As for ZRAM, it takes part of RAM and uses it with compression at runtime.

Advantage swap file is that it avoids creating a partition that cannot be used for system or user data exchange on ZRAM, it avoids using a storage drive and provides better performance, but in exchange it does not support hibernate, although it does support suspend.

Ubuntu uses a swapfile as a way to use storage media in virtual memory

Ubuntu uses “swapfile” as a way to use storage media in virtual memory.

The heterogeneous world of Linux means that every distribution has its own type exchange configured by default. Some distributions that use Calamares as an installer give the option to choose between partition, file, or no type of installer. exchangesomething that has become more common in recent years due to the large amount of RAM available in modern computers.

Due to the highly customizable nature of Linux, you can usually reconfigure exchange use the type the user wants, but the process is not as simple as in Windows. If you don’t have a very clear idea of ​​what you are doing, you should leave the default configuration, because if the developers and distribution maintainers have decided, they will have their reasons.

Virtual memory and SSD, should I be worried?

Despite being around for many years, SSDs continue to have a bad reputation for durability due to their lackluster beginnings. However, technology has improved significantly and today there are many who say they are more durable than mechanical hard drives.

The reality is that SSDs were latecomers because when mechanical hard drives came along, they were already significant bottlenecks in personal computers. On the other hand, their higher speeds allow them to better support the large number of processes that are executed in modern operating systems, not only due to issues such as virtual memory, but also indexers and some demanding applications.

answer to the question If your computer has enough RAM, there is nothing to worry about.. If the virtual memory is supported by the storage disk too often, the user will quickly notice this, although the impact on performance will be less if it is an SSD with an NVMe interface.

Don’t worry if the virtual memory is supported by the storage unit from time to time, because that’s what it’s for after all. and SSD drives offer long-term durability and reliability. This does not rule out the possibility that the SSD will go bad and have a lower than expected lifespan, but this can happen with all types of products.

Conclusions

Virtual memory is something that has been around for decades and will be with us well into the future, mainly because it is a mechanism that helps prevent system memory shortages and therefore offers a framework capable of maintaining stability in exchange for losing performance. . However, it is no less true that the capabilities it offers will not be fully utilized on a powerful PC.

Cover image: Pixabay.

Source: Muy Computer

Leave a Reply

Your email address will not be published. Required fields are marked *