What is virtual memory. What is computer virtual memory

A client contacted us with the following problem: The computer often writes “virtual memory is running out,” especially after I work in Photoshop, and there are very voluminous works. How to increase this memory?

Solution: Sometimes there may not be enough random access memory (RAM) to launch and operate the program. In this case, Windows uses virtual memory. The physical embodiment of the swap file is the file win386.swp in the Windows directory for Win9x/ME and the file pagefile.sys in the root of the disk where the operating system is installed, for WinNT, 2000, XP? Vista, 7 and 8.

What is virtual memory and how does it work?

Virtual memory or swap file (swap file) is a combination of RAM and temporary file storage on a hard drive or hard drive. If there is not enough RAM memory, the data is moved to temporary storage called the page file. Such data movement (both to and from the paging file) allows you to free up enough RAM to perform the necessary operations.

The performance of the computer depends on the amount of RAM; the more it is, the faster programs run. If there is not enough RAM, you can increase it by increasing the size of virtual memory. However, here it is necessary to take into account the fact that all data from RAM is read much faster than from a hard drive. Therefore, the best option in this situation would be to add RAM.

Sometimes error messages may pop up due to insufficient virtual memory. To ensure your software applications work properly, you must do one of the following: or .

Out of Virtual Memory Error Messages

If you receive error messages due to insufficient virtual memory, you must either add more RAM or increase the page file size to ensure your applications run properly. Typically the operating system Windows automatically controls the page file size, but if the default size is not sufficient to meet the user's needs, it can be changed manually.

How to determine the required size of the paging file?

When determining the size of a virtual memory file, it is better to proceed not from the amount of RAM, but from the tasks performed on a given computer. To do this, you need to run some kind of monitoring program that can record the volume of the swap file (for example, the “System Monitor” built into Windows) and do work typical for a given computer. The maximum size of the swap file registered during this session will be the required size.

Where to store the swap file?

If there are several hard drives in the system, then use the fastest one. If the hard drive is divided into several partitions, then on the partition located at the beginning of the disk, however, this may not work for laptops whose hard drives can arrange data not “on cylinders”, but “on surfaces”.

How to defragment the page file?

The standard Windows defragmenter cannot move the swap file. Therefore, you need to use utilities from other companies. For example, you can use Speed ​​Disk from Norton Utilities, of course, the latest versions possible.

Constant swap file size

Windows actively uses the page file, significantly relieving the computer's RAM. Microsoft made the paging file dynamic, i.e. The file size varies depending on the needs of Windows, although the best system performance is achieved with a static file. There are many reasons for this - Windows is not required every time change swap file size, fragmentation disappears, etc. In order for its volume not to change, you need to set the minimum and maximum memory values ​​to the same. To do this, use the instructions below.

Add virtual memory?

This procedure is most often needed by people who have little physical RAM on their computer, and who do not have the opportunity or desire to buy a new RAM, or most likely a new computer.

Sequence of actions to increase the paging file:

  1. Right click on “Computer”
  2. Next to “Properties”
  3. On the left, find and click: “Advanced system settings”
  4. Find and click: “Performance: Options”
  5. Click "Advanced"
  6. Find and click: “Virtual memory: Change”
  7. Select a disk that has a lot of free space.
  8. Select "Specify Size" below
  9. In “Original size” put a number in the size of the RAM
  10. In "Maximum" - 1.5 times the size of RAM
  11. Click "Set" and then OK.

This way you will increase the computer's virtual memory to improve system performance. Perhaps this will help when the computer slows down and freezes while watching a video. It also treats computer slowdown due to the load of computer games.

Add virtual memory in Windows 7

If you receive low virtual memory warnings, you must increase the minimum page file size. Windows sets the initial minimum paging file size to the amount of installed RAM, and the maximum paging file size to three times the amount of RAM on the computer. If warnings occur when using these recommended values, you will need to increase the minimum and maximum sizes.

  1. Open the System component. To do this, click the Start button, right-click Computer, and select Properties.
  2. In the left pane, select Advanced system settings. If you are prompted to enter or confirm an administrator password, enter the password or provide confirmation.
  3. On the Advanced tab, under Performance, click Settings.
  4. Click the Advanced tab and in the Virtual Memory section, click Change.
  5. Uncheck Automatically select paging file size.
  6. In the Disk [volume label] list, select the disk that contains the paging file that you want to resize.
  7. Select the Specify size radio button, enter the new size in megabytes in the Initial size (MB) or Maximum size (MB) box, click Set, and then click OK.

Note

Typically, a reboot is not required after increasing the size. However, if you reduce the page file size, you must restart your computer for the changes to take effect. Microsoft recommends that you do not disable or delete the page file.

Tips for setting up virtual memory and paging file

  • If you have several hard drives, then installing the paging file on a different HDD than the operating system is installed on usually significantly speeds up performance.
  • If you have several hard drives, then the paging file is placed on the fastest one.
  • If you have several partitions on your hard drive, then the paging file should be placed on the very first one - physically located first, since access to these areas of the hard drive is the fastest.
  • It is best to limit the minimum size of the paging file to prevent excessive fragmentation, approximately 1-1.5 times the size of your RAM. However, if you use graphics or the computer works as a database server, then you can install 2-3 volumes of RAM.
  • There is practically no point in limiting the maximum volume, since this can lead to program failures due to lack of memory, and if you do limit it, then no less than 4 volumes of RAM.
  • After these settings, you need to restart the computer and run some kind of defragmenter (such as Norton Speed ​​Disk) to completely defragment the page file and place it at the beginning of the partition.
  • Please note that after turning off the computer, the paging file may contain your passwords, logins, the rest of your confidential information, etc. This opportunity is sometimes used by people from the competent authorities and hackers, who boot into DOS and rummage through the remnants of your programs in the swap file, can find interesting things.
Computer virtual memory. How to clear your computer's virtual memory.

Computer virtual memory. How to clear computer virtual memory?

Computer virtual memory. How to clear your computer's virtual memory.

Computer virtual memory is a standard feature of most operating systems. It has become so widespread because of its low cost with very great advantages. Let's look at what virtual memory actually is and what it is used for. Today, modern computers allocate 64 or 32 MB of RAM at the disposal of the central processor. Most often, this amount of memory is not enough for the normal operation of all programs that require high speed. For example, if you load e-mail, several programs, a text editor and a Web browser at the same time, then the memory capacity will most likely not be enough. And if there were no virtual memory, then the computer would prompt us to close one or more running programs for further work. When virtual memory is used, the computer finds data in RAM that has not been recently used and copies it to the hard drive. This operation will free up some space in RAM for downloading new applications.

Since the copying is done automatically to the hard drive, many users are not even aware of what is happening, but simply think that their computers have unlimited RAM, even if only 32 MB of RAM is installed.
If the system starts accessing virtual memory frequently, the user will notice that the computer’s performance has dropped significantly. An important condition for ensuring normal operation is a sufficient amount of computer RAM for all applications with which the user has to work simultaneously - in this case, the slowdown in the performance of virtual memory will be noticeable only by a slight pause when changing tasks.

What to do if your computer's virtual memory runs out?

Sometimes, when working at a computer, on the taskbar in the right corner, the user may see a message stating that virtual memory is low and the system is running out of free virtual memory.
If you find that the computer is using memory without reserve, then in this case the amount of virtual memory can be increased. Memory in Windows is located in the page file (a file called pagefile.sys), and the operating system has the ability to change the settings for this memory. You need to follow these steps:

  • open Control Panel
  • more Systems
  • Advanced tab

After that, in the Performance section, click the Settings button. Next, in the Performance Options window, select the Advanced tab. The section called Virtual Memory will show you the amount of memory that is currently available. To change the settings, click the Change button. It is recommended to set the value to 1.5 or 2 times the specified volume. For example, with a memory capacity of 2 GB, the maximum file size can be set to 4096 MB.

How to clear computer virtual memory?

Clearing virtual memory is necessary to preserve the confidentiality of the data that remains in the paging file. In general, the paging file cleaning function is disabled. For it to start working, you need to do the following:

  1. go to the Start menu, then Settings => Control Panel.
  2. Next, in the Control Panel window, open Administrative Tools.
  3. In the window that opens, select the Local Security Policy folder.
  4. A window called Local Security Settings will open. In the list, select Shut down: clear virtual memory file, right-click and select Properties.
  5. In the Properties window, select Disable, then Apply and OK
  6. The status will be changed to Enabled

After this, the computer should be rebooted 2 times; after the 2nd reboot, the paging file will be cleared.

Hello everyone, dear readers! Dmitry Valiakhmetov is in touch with you again with another portion of fresh and useful material for novice users who want to master and consolidate the basics of managing their computer.

Please tell me, dear readers, have you, while working at a computer, ever encountered the problem of insufficient virtual memory on your computer? If yes, then you probably know that in this case a notification appears in the lower right corner of the taskbar, the content of which sounds something like this: virtual memory is running out or there is too little virtual memory.

In such a situation, users who have no idea about virtual memory begin to ask questions: how to increase the virtual memory of a computer and what is it? Very often I receive emails from users who ask me so that after increasing it, the computer’s performance does not decrease. And also what needs to be done so that the low virtual memory notification no longer appears on the computer. I will give you an example of one such letter.

Hello Dmitry! My computer constantly outputs information, there is not enough virtual memory. Please tell me how to fix this problem? What needs to be done for this? Sincerely, Vladimir.

In my opinion, this topic is very relevant, because you will agree that users who do not encounter the problem of insufficient memory on their computer do not know how to solve it. In general, to help such users, I decided to write a post on the topic of how to increase the virtual memory of a computer. In this article you will learn some useful and interesting tips that will help you fix the problem with virtual memory yourself, without seeking help from experienced users.

So, first, let's find out what types of memory exist in our computer operating system. Every computer has physical and RAM memory.

Physical memory is designed for permanent storage of any data required by programs. In other words, physical memory is a hard drive (hard drive) one of the components of a computer. If you do not know what main components a computer consists of, then I strongly recommend that you read my article:

RAM, in turn, is a container that is used by many programs for their own purposes, as temporary memory for storing various commands and addresses necessary for properly organized work. It is believed that the more such memory is installed, the correspondingly much better the performance and performance of the entire system becomes.

Virtual memory is a specific space on the hard drive that is specially allocated by the operating system. Virtual memory is also called the paging file.

During computer operation, there are situations when the operating system accesses virtual memory. Why does this happen, you ask? And all because the computer no longer has enough RAM and, as a result, a request to the paging file occurs, thereby, as it were, adding RAM. To increase RAM, you need to install an additional RAM stick on the motherboard.

However, what if you still need to increase the computer’s virtual memory? In general, of course, the operating system itself determines the size of the paging file, and if suddenly the size of the virtual memory set by default by the system is not sufficient, then the size of the paging file can be set manually.

So, you need:

1. Open the computer properties by right-clicking on the “Computer” shortcut and selecting “Properties”.

2. Then go to advanced options as shown in the picture.


3. In the window that opens, in the “Advanced” tab, in the “Performance” section, go to “Options”.

4. After that, again in the window that opens, in the “Advanced” tab, in the “Virtual Memory” section, click “Change”.

5. As a result, in the “Virtual Memory” window that opens, we see that the size of the paging file is currently set according to the system’s choice and is located on drive C. You will need to uncheck the automatic selection of virtual memory size.

6. Now activate the “Specify size” item. Here you should know that the value of the initial and maximum virtual memory values ​​depends, first of all, on the size of the installed RAM in the computer. In the “Original size” input window, specify the recommended value; I’ll give you a screenshot as an example.

In the “Maximum size” input window, the value should be one and a half or twice the original size of the RAM. In the example under consideration, the amount of RAM of the entire system is 1 GB (1024 MB).

If you do not know how much RAM is in your computer, then you can easily find out by going to the computer properties (at the beginning of the article I told you to remember the value of the installed memory). After entering the numerical values, click “Set” and in each window that opens, click “OK”. Next, you will need to restart your computer for the changes we have made to take effect. As a result of the operations performed, the amount of virtual memory will increase.

The reasons for the lack of RAM in the operating system may be such a factor when, for example, a huge number of programs are used on the computer and due to the fact that the installed RAM is too small in volume, this in turn leads to a noticeable decrease in the speed of the computer. In this case, many programs begin to work incorrectly, and sometimes there is a delay in closing the program itself, which subsequently causes not only the program to freeze, but the entire computer as a whole.

In addition, we can add that the most common situations are when a program does not free up areas of RAM that it does not need, and this situation is usually called a memory leak. In his article:

I listed the main ways to increase the speed of your computer, I recommend that you read this article, in which you will learn the main nuances that are necessary to speed up your computer. In addition, you will learn how to clean up virtual memory.

So, dear users, now you, knowing how to increase computer virtual memory You can perform the above procedure at any time. For today, that’s all I wanted to tell you about in terms of virtual memory. I hope the article was useful to you!

A computer's virtual memory acts as a supplement to RAM and is part of the RAM located on the hard drive. This gives the computer user the feeling that he has unlimited RAM.

Virtual memory is found in almost all operating systems designed for desktop computers. The system requirements of many application programs are growing at a very rapid pace from version to version. And despite the fact that the amount of RAM installed on modern models of desktop computers has increased significantly, quite often a situation arises when it is not enough.

Especially in cases where the user simultaneously runs several resource-intensive programs. Hence the need for virtual memory arises.

What is virtual memory?

Let's just say that this is a technology that allows an application program to “believe” that it has an unlimited amount and contiguous address space of memory. Although in reality the memory is physically fragmented and its volume is artificially increased on the hard drive.

Systems that use virtual memory are able to run applications that exceed the capabilities of RAM at high speeds and use physical memory more efficiently than without it. Virtual memory is different from virtualization technology.

How does virtual memory work?

This is a very useful and necessary technology that uses the actual space of the hard drive, manipulating data using the operating system and moving it, if necessary, from RAM to the hard drive. Some of the hard drive space acts as temporary storage. The operating system determines what data is stored in what location and provides quick access to it, allowing the system to operate as quickly as possible.

Virtual memory works in coordination with RAM; the operating system determines which data located in RAM has not been used by the system for a relatively long time and dumps it into virtual memory. If necessary, they can be moved back to RAM. Secondary storage devices, such as a hard drive, have large storage capacity but provide very slow data access.

How is virtual memory organized?

Virtual memory uses paging file or segmentation technology. Most systems use page tables to translate virtual addresses into physical addresses that the processor uses to execute instructions. The page table stores entries to map virtual addresses to physical addresses. Systems may have one page table for the entire system or separate page tables for each application program.

Thus, paging can be defined as the process of moving inactive virtual memory pages to disk and restoring them to RAM upon request. There are various algorithms to choose which pages should be transferred to the hard drive and which should be saved.

Very few systems use the concept of segmentation to implement virtual memory. In segmentation, memory is divided into segments of variable size. The segment number and the offset within the segment together form the virtual address.

If the processor wants to retrieve a specific data item, it first looks up the table segment number for its segment to find the segment descriptor (description). The segment descriptor provides information whether the offset within the segment is less than the length of the segment, and if no interrupt is generated, notifies that the segment has been found.

If the processor cannot find a segment in main memory, it generates a hardware interrupt to request the operating system to change the segment. The operating system then looks for segments that have not been used for a long time and replaces them, moving them from RAM to the hard drive to make room for new segments to be read.

How to increase virtual memory?

If you want to increase the amount of virtual memory on your system, then check out the step-by-step instructions. (For Windows XP):

    Open the “Start” menu, select the “Control Panel” command Select “Performance and Maintenance” Next select “System” Select the “Advanced” tab Select the “Performance” section and click the Settings button Select the “Advanced” tab In the “Virtual Memory” section, click to the "Change" button. In the Disk [volume label] list, select the disk containing the page file if you want to change the size of its virtual memory. You can select the amount of memory you want to reserve for virtual memory by entering an initial and maximum size. Click the "Set" button Restart your computer

If you feel like your computer is running too slow, increasing virtual memory won't help; it may only be the result of "slipping." Too frequent shuffling of virtual memory blocks between real memory and disks consumes most of the computer's operating time, thereby causing throttling. Although there are some measures that can optimize the performance of virtual memory, the best solution is to increase the amount of RAM.

Maximum performance from any computer is provided by its four main components. These include: central processor, RAM, processor and video card memory and hard drive. This, of course, includes the motherboard, because if the bandwidth of its interfaces and the bus frequency are not high enough, this will negatively affect the maximum performance of the computer as a whole. But at the moment we are interested in only one component of the computer, which plays one of the main roles in the play called “Computer Performance”. And as is clear from the title of the article, we will talk about the paging file and virtual memory.

What is it swap file? I think you already guessed that this is a file. But why is it called a page file and what is it for? The answer is very simple. When using a large number of applications simultaneously (for example, you have Photoshop, 3ds Max, a browser running and music is still playing in the background), the amount of RAM may simply not be enough to process them. And then the system turns to the file that is created on the hard drive (or hard drive) in order to use its space as the missing amount of RAM. This file, as it were, supplements and pumps up the amount of RAM with its volume. That is why it received such a name.

Together, the amount of RAM and the paging file is usually called virtual memory. That is, the amount of virtual memory consists of the amount of RAM and the page file. I hope you understand. And sometimes it may happen that when working in some complex resource-intensive applications, you suddenly run out of virtual memory. In this case, not everyone will run to the store to buy an additional stick of RAM to increase the amount of virtual memory. The easiest way would be to increase the size of the paging file itself. Still, finding a couple of gigabytes of free space on your hard drive is much easier than buying additional RAM.

Swap file is a file called “pagefile.sys” and is located by default on the system local drive “C”. I suggest you familiarize yourself with the settings of this file. I experimented a lot and came to the conclusion that the location of the paging file on the system disk still negatively affects the speed of virtual memory. Therefore, I recommend placing it on another local drive, for example, on drive “D”. To open the paging file settings, right-click on the “Computer” icon and select “Properties” from the list that appears. Or press the keyboard shortcut “Win” + “Pause” (where “Win” is the key with the Windows icon).


A window will open with basic information about your computer. Here, by the way, you can see how much RAM is installed in your system unit. We are interested in “Advanced system parameters”, which is where we go.

A small System Properties window will open. Here you need to click the “Options” button in the “Advanced” tab and the “Performance” area.

Another small window will open where you can configure system performance parameters. We are interested in the “Advanced” tab, so select it.

Here in the area " Virtual memory» select “Change”.

Another small window will appear in which the paging file is configured. This is the so-called optimization of the Windows 7 system. So, I have already said that it is best to place the paging file on any local drive other than the system “C”. To disable page file from drive “C”, simply select it by left-clicking the mouse, set the switch with the left mouse button to the “Without paging file” position, and then click the “Set” button.

A notification will immediately appear stating that if you disable the paging file, there will be nowhere to write debugging data if a critical error occurs in the system. But don’t worry, we’ll create a swap file right away, just on a different drive. So feel free to click the “Yes” button. That’s it, we’ve removed the paging file from drive “C”.


Now I suggest placing it on the “D” drive. Click on drive “D” (for you it may be another drive, for example “E” or “F”) so that it is highlighted. And put the switch in the “Specify size” position. The system recommends setting paging file size one and a half times the total amount of installed RAM (that is, if you have 4 GB of RAM installed, the page file should be 6 GB). But I would not rush to do this if I were you. The size of the paging file depends, first of all, of course, on the amount of RAM, and secondly, on what applications (or programs) you will use. Let's assume that you have 4 Gigabytes of RAM installed, and you basically do not use anything except the Internet, watching movies and listening to music. In this case, a swap file of 2 Gigabytes in size will be, as they say, for the eyes. But if you use resource-intensive applications and modern games, feel free to set it to 8 GB or even more.

There is no need to worry too much; you can increase the size of the paging file at any time. I also recommend that you set the “Maximum size” and “Original size” fields to the same value. In this case, the size of the paging file will be fixed. This is done to prevent fragmentation of the hard drive. But we will talk about this in another topic. Please also note that the values ​​are entered in megabytes. Let me remind you that one gigabyte contains 1024 megabytes. Let's say we need to set the page file size in Windows 7 to four gigabytes. Multiply 1024 by 4 and get 4096 megabytes. Enter this value in the “Maximum size” and “Initial size” fields and click the “Set” button. To save the settings, click the “OK” button.

A message appears stating that you must restart your computer for the settings to take effect. Click OK.


After that, click the “Apply” button and then “OK”.

In the next window, click "OK".

A small window will open prompting you to reboot. Click "Reboot Now".

After the reboot, the parameters you set will be in effect, for which I congratulate you. Windows 7 system setup, or rather one of many operating system settings, is over.

communication between hardware and software. The hardware aspects will be discussed first. virtual memory, and then questions arising during its software implementation.

The concept of virtual memory

Software developers often have to deal with the problem of storing large programs in memory that are larger than the amount of available RAM. One of the options for solving this problem - organizing structures with overlap - was discussed in the previous lecture. In this case, the active participation of the programmer in the process of forming overlapping parts of the program was assumed. The development of computer architecture and the expansion of the operating system's memory management capabilities made it possible to shift the solution to this problem to the computer. One of the main achievements was the emergence virtual memory(virtual memory). It was first implemented in 1959 on the Atlas computer, developed at the University of Manchester.

The essence of the concept virtual memory is as follows. The information that an active process works with must be located in RAM. In the diagrams virtual memory the process has the illusion that all the information it needs is in main memory. To do this, firstly, the memory occupied by the process is divided into several parts, for example pages. Second, the logical address (logical page) accessed by the process is dynamically translated into a physical address (physical page). Finally, in cases where the page being accessed by a process is not in physical memory, it needs to be swapped from disk. To control the presence of a page in memory, a special presence bit is introduced, which is part of the page attributes in the page table.

Thus, there is no need to have all process components in main memory. An important consequence of this organization is that the size of memory occupied by a process can be larger than the size of RAM. Locality principle provides this circuit with the required efficiency.

The ability to execute a program that is only partially in memory has a number of very obvious advantages.

  • The program is not limited by the amount of physical memory. Program development is simplified because large virtual spaces can be used without worrying about the amount of memory used.
  • Since it becomes possible to partially place a program (process) in memory and flexibly redistribute memory between programs, more programs can be placed in memory, which increases processor load and system throughput.
  • The amount of I/O required to download part of a program to disk can be less than in the classic swap version, as a result, each program will run faster.

Thus, the ability to provide (with the support of the operating system) for a program "visibility" practically unlimited (the typical size for 32-bit architectures is 2 32 = 4 GB) addressable user memory (logical address space) in the presence of main memory of significantly smaller sizes (physical address space) is a very important aspect.

But introduction virtual memory allows you to solve another, no less important task - providing access control to individual memory segments and, in particular, protecting user programs from each other and protecting the OS from user programs. Each process works with its own virtual addresses, which are translated into physical ones by computer equipment. Thus, user process deprived of the ability to directly access main memory pages occupied by information related to other processes.

For example, a 16-bit PDP-11/70 computer with 64 KB of logical memory could have up to 2 MB of RAM. operating system this computer nevertheless supported virtual memory, which provided protection and redistribution of main memory between user processes.

Recall that in systems with virtual memory those addresses that the program generates (logical addresses) are called virtual, and they form a virtual address space. The term " virtual memory" means that the programmer is dealing with memory other than real memory, which is potentially larger than the size of RAM.