What do page out of memory errors say? Device Manager Error Codes 100 Physical Memory Errors

What do page out of memory errors say? Device Manager Error Codes 100 Physical Memory Errors

When a process starts in Windows, many of the pages that display EXE and DLL file images may already be in memory because they are being used by other processes. Writable image pages are labeled "copy-on-write" so they can be shared until they need to be modified. If operating system recognizes an EXE that was already running, it can write the page link template (using a technology that Microsoft calls Super-Fetch). This technology tries to prefetch many necessary pages in advance (although the process has not yet received page faults on them). This reduces the latency of launching applications (reading pages from disk is superimposed on the execution of the initialization code of images). This technology improves disk output performance by making it easier for disk drivers to orchestrate read operations (to reduce the required seek time). This prefetching process is also used during system boot, as well as when a background application comes to the foreground and when the system resumes from hibernation.

Forward paging is supported by the memory manager, but is implemented as a separate system component. Swapped pages are not inserted into the process's page table, instead they are inserted into a standby list, from which they can be quickly inserted into the process (without disk access).

Unmapped pages are somewhat different - they are not initialized by reading from a file. Instead, the first time an unmapped page is accessed, the memory manager provides a new physical page (making sure its contents are zero-filled for security reasons). On subsequent page faults, the unmapped page may need to be found in memory or read from the swap file.

Demand paging in the memory manager is controlled by page faults. Every error causes an interrupt to the kernel. The kernel then builds a machine-independent handle (which reports what happened) and passes it to the runtime memory manager. The memory manager then checks the access for validity. If the failed page falls within the committed area, then it looks up the address in the VAD list and finds (or creates) the process's page table entry. In the case of a shared page, the memory manager uses the prototype page table entry (associated with the segment object) to populate the process's new page table entry.

The page table entry format differs depending on the processor architecture. For x86 and x64 processors, the elements of the displayed page are shown in fig. 11.17. If an element is marked as valid, then its contents are interpreted by the hardware (so that the virtual address can be translated into a valid physical page). Unrendered pages also have their own elements, but they are marked as invalid, and Hardware ignores the rest of the element. The software format is slightly different from the hardware format and is determined by the memory manager. For example, for an unmapped page (which must be laid out and zeroed before being used), this fact is noted in the page table entry.


Two important bits of the page table entry are updated directly by the hardware. These are the access bit (A) and the changed bit (D). These bits keep track of usage given mapping pages to access the page and the ability to modify the page with this access. This really improves system performance because the memory manager can use the access bit to implement Least-Recently Used (LRU) paging. The principle of LRU is that those pages that have not been used the longest have the least chance of being reused in the near future. The access bit allows the memory manager to determine that the page has been accessed. The "modified" bit tells the memory manager that the page may have been modified (or, more importantly, it has not been modified). If the page has not been modified since it was read from disk, then the memory manager does not need to write its contents to disk (before using it for something else).

Both the x86 and x64 architectures use a 64-bit page table entry (see Figure 11.17).

Each page fault can be classified into one of five categories:

1. The page is not fixed.

2. Attempt to access a page with permission violation.

3. Attempt to modify a copy-on-write page.

1. Need to increase the stack.

2. The page is fixed, but in given time not displayed.

The first and second cases are programming errors. If a program tries to use an address that does not have a valid mapping, or tries to perform an illegal operation (such as trying to write to a read-only page), this is called an access violation and usually results in the termination of the process. An access violation is often the result of invalid pointer values, including access to memory that has been freed and detached from the process.

The third case has the same symptoms as the second (an attempt to write to a read-only page), but its handling is different. Because the page was marked copy-on-write, the memory manager does not throw an access violation. Instead, it makes a private copy of the page for the current process, and then returns to the thread that attempted to write to the page. The thread retries the write operation, which will now complete without a page fault.

The fourth case occurs when a thread pushes a value onto its stack and hits a page that hasn't been allocated yet. The memory manager recognizes this as a special case. As long as there is room in the virtual pages reserved for the stack, the memory manager will supply new pages, zero them out, and map them to the process. When the thread resumes execution, it will retry the access, and this time it will succeed.

And finally, the fifth case is a normal page fault. However, it has several sub-variants. If a page is mapped to a file, then the memory manager must examine its data structures (such as the prototype page table associated with the segment object) to ensure that there is no copy of it in memory. If there is a copy (for example, in another process, in a standby list, or in a list of modified pages), then it will simply make it shared (it may have to mark it as copy-on-write to do this if the changes are not shared). supposed). If there is no copy yet, the memory manager will allocate a free physical page and prepare it for copying a page of the file from disk into it, unless another page is being transferred from disk at that moment (in which case you just need to wait until this transfer is completed).

If the memory manager can handle a page fault by finding the correct page in memory (rather than reading it from disk), then the error is called a soft fault. If you need a copy from disk, then this is a hard fault. Soft bugs are much cheaper and have little impact on application performance (compared to hard bugs). Soft errors can occur because the shared page has already been mapped to another process, or just a new zeroed page is needed, or desired page has been removed from the working set of a process, but is requested again before being reused. Soft errors can also occur because pages have been compressed to effectively increase the size of physical memory. For most CPU configurations, memory and I/O in current systems it is more efficient to compress instead of wasting expensive I/O (in terms of performance and power consumption) that requires reading a page from disk.

When physical page is no longer displayed by the page table of any of the processes, it falls into one of three lists: free, modified, or reserve. Those pages that are never needed again (such as the stack pages of a terminating process) are freed immediately. Those pages that can give a page fault again are either in the modified list or in the reserve list (depending on whether the "modified" bit was set for any page table element that displayed this page since it was last read from disk). Pages from the modified list will eventually be written to disk and then moved to the reserve list.

The memory manager can allocate pages as needed (using a list of either free or reserved pages). Before allocating a page and copying it from disk, the memory manager always checks the lists of reserved and modified pages to see if the page is already in memory. The paging scheme in Windows converts future hard errors into soft ones (by reading pages that might be needed and putting them on the fallback list). The memory manager itself performs a small amount of paging ahead - it accesses groups of consecutive pages (rather than individual pages). Additional pages immediately placed in the list of reserve pages. This is not a waste, since the overhead of the memory manager is much less than the cost of performing I/O operations. Reading a whole cluster of pages is slightly more expensive than reading a single page.

Page table elements in fig. 11.17 refer to physical (not virtual) page numbers. The kernel needs to use virtual addresses to update the page table entry (and page directory). Windows maps the page tables and page directories for the current process to the kernel's virtual address space using the self-map element in the page directory (Figure 11-18). By mapping a page directory entry to a page directory (self-map), we obtain virtual addresses that can be used to refer to page directory entries (Figure 11.18a) and page table entries (Figure 11.18b). The self-map takes up 8 MB of kernel virtual addresses per process (on x86 processors). For simplicity, the figure shows the x86 self-map element for 32-bit PTE records (Page-Table Entries). In fact, Windows uses 64-bit PTEs, so the system can use more than 4 GB of physical memory. With 32-bit PTE entries, the self-map element uses only one PDE entry (Page-Directory Entry) in the page directory and therefore takes up only 4 MB of addresses, not 8 MB.

Many computing systems incorporate one or another version of the memory manager (another name is the memory manager - MUP), with the help of which the multitasking operating system allocates memory to each task and provides protection from user programs. For example, a typical problem occurs when an application program makes an error in computing an address, perhaps using an index value that is too large or too small. If there is no protection in the system, this kind of error can change the codes included in the operating system programs or modify the device tables and even cause an unplanned start of the device with fatal consequences, such as an unauthorized write to the data file.

In addition to protecting the operating system from inadvertent destruction, the memory manager provides automatic program relocation. The memory manager converts the logical or program addresses of user programs into physical or hardware addresses. These addresses may be located in memory completely different from where logical addresses point. Address translation results in the complete removal of the operating system and protected I/O devices from the user's address space. Any attempt to read or write to memory outside the user's address space causes the processor to crash the user's program.

Information is usually transmitted in chunks consisting of a fixed number of bits; The 80386 MP uses chunks of 32 bits unless it is instructed to reduce chunk sizes to 16 bits. These portions are called words. The process of writing a word into a memory system is called memory entry, the process of getting a word from memory - reading from memory.

There are two memory access methods: random and sequential. Sequential access is used in those memory systems where words are accessed in some predetermined order. Random access, on the other hand, involves the possibility of accessing the words of a storage system in any order and in approximately the same time.

No matter how perfect the memory is, when the signal passes between devices, there are delays in its propagation. Propagation delay is defined as the time required for a logic signal to travel through a device or a sequence of devices forming a logic chain. This delay also takes into account the signal passing through all interconnecting lines between microcircuits.

Direct Memory Access (DMA)

Direct memory access allows external devices and memory to directly exchange data without program intervention. DMA provides maximum I/O speed and maximum process parallelism. While interrupt I/O and software-controlled I/O transfer data through the processor, in the case of DMA, data is transferred directly between the I/O device and memory.

In order to minimize the number of data buses, special measures are taken to allow the use of a conventional backbone for RPS. These measures consist in the fact that the processor releases the highway, and the external device captures it and uses it to transfer data.

For the duration of the RAP, the execution of the program is usually suspended. The trunk is released as soon as the RAP request control line is excited. The processor ends the current operation, releases the address and data lines, and asserts a signal on one of the control lines to prevent inadvertent decoding of undefined control signals.

The I/O interface transfers data directly to memory using a special register. When it needs to transfer data, the interface asks the processor for a memory cycle. Once acknowledged, the interface sends the data directly to memory while the processor pauses for one memory cycle. The logic that performs this transfer is called channel.

The channel contains a register to store the address of the memory location to or from which data is being transferred. In most cases, the channel also includes a word counter to count the number of direct transfers made. In addition, the channel must contain a circuit that provides the exchange of control signals, synchronization and other auxiliary operations. On fig. 13.4 shows the logical connections between the CPU and the PDP controller.

RAP components. The main components of a DMA are a request trigger, an address register, a counter, and a data register that is used by the peripheral. Forwarding data over a DMA channel includes several steps: 1) initialization of the DMA logic to perform the DMA during repeated backbone occupation cycles; 2) asynchronous with respect to the program operations activation of the RAP; 3) notification of the end of transfers (on a signal from the counter or as a result of a change in the state of the device); 4) calling the "cleanup" program at the end of transfers; 5) completion of the DMA with the help of an interrupt handler, which returns control to the main program.

Block data transfer. The DMA procedure for high-speed devices uses data transfer in blocks. By executing the current program, the processor initiates the transfer of a block of data and determines the number of words that make up the block. However, the actual transmission of words is performed under the control of a separate device - the PMA controller. Max Speed block transmission over the DMA channel is limited only by the duration of the memory cycle (read or write) and the speed of the DMA controller.

RAP with occupation of the memory cycle. The program initiates a block transfer by placing the start address in the address counter and the number of words in the word counter. and issuing a run command. This type of RAP is often referred to as RAP with occupying the memory cycle, because it pauses program execution for approximately one machine cycle each time.

When using DMA with a memory cycle, data transfer is carried out in parallel with other processes performed by the CPU. The sequence of actions here is the same as for block transfer, with the exception that the DMA controller takes up memory cycles from the processor and, therefore, slows down its operation (block data transfer over the DMA channel also takes memory cycles, unless DMA is used on a separate bus).

Preemptive/nonpreemptive algorithms.

In the case of a preemptive algorithm, the operating system can at any time interrupt the execution of the current thread and switch the processor to another thread. In non-preemptive algorithms, the thread given the processor decides when to hand over control to the operating system.

Algorithms with quantization.

Each thread is given a time slice during which the thread can run on the processor. When the quantum expires, the operating system switches the processor to the next thread in the queue. The quantum is usually equal to an integer number of intervals of the system timer 1 .

Algorithms with priorities.

Each thread is assigned a priority (priority) - an integer indicating the degree of privilege of the thread. The operating system, if there are several threads ready to execute, selects the thread with the highest priority among them.

Windows implements a mixed scheduling algorithm - preemptive, based on quantization and priorities.

  1. Multitasking type for DOS application
  2. Service Guarantees
  3. Scheduling foreground processes
  4. Purpose of the swap file
  5. Processes P1, P2, P3 allocate 100, 20, 80 MB of memory. The system has 128MB of OP. What is the size used memory in the swap file. What is the size of the swap file.
  1. What is a "page fault"?

Interrupt 14 -page fault (#PF): Intel386 ...

It is generated if the paging mechanism is activated (CR0.PG = 1) and one of the following situations occurs when translating a linear address into a physical one:

  • element of the page table or page catalog used in address translation, has zero presence bit, i.e. the desired page table or page is not present in physical memory;
  • procedure does not have privilege level, sufficient to access the selected page, or attempts to write to a page that is write-protected for the current privilege level.

The page fault handler obtains information about its cause from two sources: the error code pushed onto the stack, and the contents of CR2, which contains the linear address that caused the error. The page error code has a special format (Fig. 3.7.).

An interrupted program, after eliminating the causes that caused the page fault (for example, a page load in physical memory), can be continued without any additional adjustments.

If a page fault was caused due to a violation of page security privileges, then the access bit (A) in the corresponding page directory entry is set. The behavior of the access bit in the corresponding element of the page tables for this case is not regulated in Intel processors and may be different in different models.

  1. A high page fault rate indicates:

Unreliability of the program

Unreliability of RAM

Other: explain

Column "Errors of the absence of a page in memory / sec."

In the column "Page out of memory errors / sec." (Hard Faults/sec) indicates the average number of memory page faults per second over the last minute. If a process tries to use more physical memory than is available this moment time, the system writes part of the data from memory to disk - to the paging file. The subsequent access to the data saved to disk is called a page out of memory error.

What do page out errors indicate?

Now that you have an idea of ​​what information is collected in the Processes table, let's see how to use it to monitor memory allocation. As applications start and work with files, the memory manager keeps track of the working set size for each process and captures requests for additional memory resources. As a process's working set increases, the dispatcher matches these requests to the needs of the kernel and other processes. If there is not enough available address space, the dispatcher shrinks the working set by saving data from memory to disk.

Later, when reading this data from disk, a page out of memory error occurs. This is quite normal, but if errors occur simultaneously for different processes, the system needs additional time to read data from disk. Too frequent page out of memory errors, respectively, reduce system performance.. You have probably experienced an unexpected slowdown in all applications, which then also suddenly stopped. Almost certainly, this slowdown was due to the active reallocation of data between physical memory and swap.

The conclusion follows from this: if out-of-page errors for a particular process occur too often and moreover regularly, The computer does not have enough physical memory.

To make it easier to monitor processes that cause frequent page out of memory errors, you can mark them with flags. This will move the selected processes to the top of the list, and the page out of memory error graph will be represented by an orange curve.

It is worth considering that memory allocation depends on a number of other factors, and monitoring page out of memory errors is not the best and does not the only way identifying problems. However, it can serve as a good starting point for observation.

  1. How Thread Priority is Formed in Windows

Priorities

Windows implements preemptive priority scheduling, when each thread is assigned a certain numerical value - a priority, according to which a processor is allocated to it. Threads with the same priorities are scheduled according to the Round Robin algorithm (carousel). An important advantage of the system is the ability to preempt threads running in kernel mode - the code of the executive system is completely reentrant. Only threads holding the spinlock are not preempted (see "Thread Synchronization"). Therefore, spinlocks are used with great care and set to a minimum time.

The system has 32 priority levels. Sixteen priority values ​​(16-31) correspond to the real-time priority group, fifteen values ​​(1-15) are for normal threads, and a value of 0 is reserved for the system page-zeroing thread (see Figure 6.2).

Rice. 6.2. Thread Priorities

To save the user from having to remember the numerical values ​​​​of priorities and be able to modify the scheduler, the developers introduced into the system priority abstraction layer. For example, the priority class for all threads of a particular process can be set using the set of constant parameters of the SetPriorityClass function, which can have the following values:

  • real time (REALTIME_PRIORITY_CLASS) - 24
  • high (HIGH_PRIORITY_CLASS) - 13
  • above normal (ABOVE_NORMAL_PRIORITY_CLASS) 10
  • normal (NORMAL_PRIORITY_CLASS) - 8
  • below normal (BELOW_NORMAL_PRIORITY_CLASS) - 6
  • and broken (IDLE_PRIORITY_CLASS) 4

The relative thread priority is set by the same parameters of the SetThreadPriority function:

The combination of six process priority classes and seven thread priority classes forms 42 possible combinations and allows forming the so-called basic thread priority.

The base priority of a process and the primary thread defaults to a value in the middle of the process priority ranges ( 24, 13, 10, 8, 6 or 4). Changing a process's priority changes the priorities of all of its threads, leaving their relative priorities unchanged.

Priorities 16 through 31 are not really real-time priorities, because under Windows' soft real-time support, no guarantees are made about the timing of threads. These are simply higher priorities that are reserved for system threads and those threads that are given such priority by a user with administrative rights. However, the presence of real-time priorities, as well as the preemptibility of the kernel code, the localization of memory pages (see "Memory manager operation") and a number of additional features- all this allows you to perform in the OS environment Windows Applications soft real-time, such as multimedia. The system thread with zero priority is engaged in zeroing memory pages. Regular user threads can have priorities from 1 to 15.


Similar information.


You have connected a new device, but it is in no hurry to work, or the old device has stopped functioning, or does not work correctly. What to do in these cases? Reinstall everything? It's a hassle, and it's not always necessary. How to find out what is the reason and how to eliminate it? Very simple. The fact is that in the operating system of the Windows family, and not only, there is, someDevice Manager, in fact, a very necessary and useful manager, if you can call him that. Here it is, it will help us find out what is the cause of the problem, and my cheat sheet will fix the problem. So, in the aboveDevice Manager there are traces of errors in the operation of devices in the form of codes. Knowing the error code, it is easy to determine the cause of the problem. For the uninitiated, the codes are just incomprehensible and meaningless numbers. But to a knowledgeable user, they can tell a lot. I will try my best to shed some light on this subject.


To view device errors, we first need to enter the Device Manager itself. It is done like this. Sign inControl Panel from the menuStart ( Can,My computer , right-clickProperties Device Manager, and it is also possible through the task of the command inexecute , but why complicate things). If we enter throughPanel management , then the path is:System - Hardware - Device Manager . Choose by entering the menudevice Manager , the type of device we are interested in (keyboard, printer, modem, etc.), double-click on it, as a result we will see the devices included in this type. Select the device we need and double-click on it. We look at the column on the About tabgeneral, device status. If there is a problem with the operation of the device, it will be displayed here as an error code. So we see numbers and numbers. What do they stand for. Below I present full list mistakes, with brief description mistakes and possible ways elimination. The error code is highlighted in red, its description in blue and the elimination in black.

Code 1Device setup problem correct settings or the driver is missing. Click the button Update Driver , to start the wizardHardware upgrade . If there is no driver at all, install it.

Code 3The device driver is damaged, as an option there is not enough RAM for the device to work correctly.1. Remove the damaged driver and install a new one. To do this: Properties - Driver - Delete, then follow the instructions of the wizard. Reboot. We open againdevice Manager Action Update hardware configuration and follow the instructions of the wizard. 2. If the problem is lack virtual memory, close running applications to unload memory. To check the state of the memory we need to get intoTask Manager , to do this, press the key combinationCtrl+Shift+Esc.We can see the virtual memory settings by right-clickingMy computer Properties - Advanced - Performance - Settings (Options) . You can try to increase the swap file (I described how this is done in one of the previous articles on my blog), but this is far from a drastic measure. You have to increase RAM. How this is done is a separate topic that goes beyond the scope of this post.

Code 10The registry key has a device-specific settingFailReasonString,the value of this parameter is displayed in the error data, that is, if there is no parameter as such, then an error code appears, in other words, the device cannot be started. Update the driver as above. Or install a newer one.

Code 12There is no stock of resources required for this device. Disable other running devices, at least one, to do this, use the troubleshooting wizard, which, if you follow its instructions, will disable the conflicting device. (In short, let me remind you: Properties - General - Troubleshooting.)

Code 14Requires a PC restart for this device to work.

Code 16It is not possible to identify the resources that are necessary for the operation of the device, the device is not fully configured. You need to assign additional resources to the device. But this can be done without problems if the device belongs toPlug and play.

Properties - Resources. If there is a resource with the ? sign in the list of resources, select it to assign it to the selected device. If the resource cannot be changed, clickChange settings , if this function is not available, uncheck the boxAutomatic setting

Code 18Reinstall the device driver. We try to update the driver or remove it and do it, as in the example withcode 3.

Code 19Insufficient information in the registry about the device settings, or the settings are corrupted. RunTroubleshooting Wizard and follow his instructions, it will not help - reinstall the device, as mentioned above. (code 3). Or, if that doesn't work, downloadLast Known Good Configuration. If this does not help, you need the help of a specialist, as it is necessary to edit the system registry. Lacking knowledge and experience, on your own, there is nothing for you to do there, any system administrator will confirm this for you. Knowing and able, he knows how to do it, without me. And for the inexperienced, it's better not to try. The registry is the heart of the operating system and only an experienced specialist, or under his guidance, should carry out operations on it. In no way do I want to offend anyone, but if you have not worked with the system registry and if your computer is dear to you, my advice is to forget your way there. I do not write for professionals, they do not need it, but for the average user. Of course, I can write how and what to do there, but this will be an explanation on the fingers, and if you, as a result of the slightest mistake, damage your computer, I will be to blame. I don't need it at all, and neither do you.

Code 21 The device is removed from the system, that is, the operating system is trying to remove the device, but the process has not yet completed.


Pause for a few seconds and press the key


Code 22 The device is disabled. The device must be turned on.Action - Enable and follow further instructions.


Code 24 The device is missing or incorrectly installed, the driver has failed, the device may have been prepared for removal. Remove the device and reinstall.


Code 28 There is no driver. Install the driver. To do this, you need to Update the driver, the steps are as in the instructions for Code 1.


Code 29Disabled device . You need to allow the device to work in settingsBIOS,read the instructions for using the device.


Code 31The system was unable to load drivers for this device. . Update your drivers as described above.


Code 32The driver for this device is disabled in system registry . Uninstall and reinstall the driver (described above)


Code 33The operating system cannot determine the resources for this devices . Set up the device or replace it.


Code 34The operating system cannot determine the settings devices . Review the hardware documentation that came with it and manually configure it on the Resources tab.


Code 35The PC firmware does not have the necessary information to properly device operation . Need to updateBIOS.For instructions on how to do this, contact the supplier, but it is better to use the services of an experienced craftsman.


Code 36The device requires an interrupt to operate.PCI,and the device is set to interruptisa,or vice versa . Need to change settingsBIOS,refer to an experienced master.


Code 37The operating system does not recognize the driver for this device. . Reinstall the driver (described above).


Code 38The OS cannot load the driver for the device because, the previous version of the driver remains in memory . You need to restart your PC. Run the Troubleshooting Wizard if it does not start (Properties - General - Troubleshooting) and follow the instructions of the wizard. After a mandatory reboot.


Code 39The OS cannot load the device driver. Driver is corrupted or not at all . Reinstall the driver as described above.


Code 40There is no access to the equipment, as there is no information in the system registry or the information contains an error . Reinstall the driver.


Code 41Device not detected . Run the Troubleshooting Wizard (described above), if it does not help, update the hardware configuration (see above) or update the driver. If not, install more new version drivers.


Code 42The system already has such a driver. That is, there are two different devices With the same name, possibly due to an error . Restart your PC.


Code 43Stopping the device due to problems in its operation . Run the Troubleshooting Wizard and follow its instructions.


Code 44An app or service has stopped the device . Restart your PC.


Code 45Device not connected . Connect your device.


Code 46This error appears when the operating system shuts down. Nothing needs to be done, the next time you start the OS everything will work.


Code 47 The device has been prepared for safe removal, but not yet deleted (e.g. flash) . Remove the device, then plug it back in, restart your PC.


Code 48The device, or rather its software, is blocked . Update the driver or install a new one.


Code 49The device cannot be started because it has a large system registry hive that exceeds valid parameters registry . Delete devices that are not in use from the registry. You can do this: Device Manager - View - Show hidden devices. Here you will see hidden devices that are not connected to your PC. Select the devices you want to remove, click Properties for the device - Driver - Uninstall, then follow the instructions of the wizard and finally restart the PC.


Manual for removing any viruses from your PC with your own hands. All methods of removing viruses are really working and proven in practice, step-by-step instruction with illustrations - simple and accessible even for a schoolchild + video tutorials + ultraiso program to create bootloaders + useful links to tools in the fight against viruses. Download archive