View familiar strangers uncover the secrets of system resources

Source: Internet
Author: User
Tags high cpu usage

From: computing machine application Abstract

Many of my friends may not be unfamiliar with the term "system resources" in computers. We often see it in newspapers or books, how much do you know? Many of my friends have been confused about the usage of system resources and memory. What is the actual situation? To find out the answer to the question, let's unveil the secrets of system resources together with this article.

I. Trace the source to find out the meaning of various resources

The concept of resources is divided into the following: CPU resources, memory resources, system resources, user resources, and GDI resources, are there any connections between them? To get out of the misunderstanding, we must first understand their meaning.

Menu location and other information are retained in the system resource space

Let's start with system resources. To put it simply, when an application is running, the memory needs a space to track and retain the status of the program being executed, such as buttons, cursors, menu positions, bitmaps, and window states, the space for storing this information is described as a proprietary term, which is a familiar "system resource". The space for storing this information is a memory block called a "Heap, you can think of "heap" as memory space managed by special mechanisms.

Based on Different Storage object types, system resources are divided into two aspects: user resources and GDI (Graphic Device Interface, graphical Device Interface) resources. The heap managed by volume is called the GDI resource heap, which is used to store image object information such as painter, paint brush, Font, and color palette. User Resource Heap and GDI resource heap are collectively called system resource heap, which are traditionally called system resources.

Now we should understand that system resources and memory resources are not the same thing. We can say that the amount of memory resources a program uses actually refers to the amount of memory space required for running the program. based on factors such as the degree of optimization and functional strength of the software design, some require only a few hundred KB, some require dozens or even hundreds of MB, which is usually much larger than system resources.

CPU resources are better understood. It actually refers to the CPU usage. When the software is running, it uses the CPU for Data calculation, which takes a certain amount of CPU execution time, CPU usage is an important indicator of software and hardware design. Some poorly designed or endless programs tend to leave the system unresponsive because of their high CPU usage. In some software evaluation articles, we can also see Comments "resource usage is too high", but in fact this is not comprehensive, we should specifically point out which type of resource occupation is too high, such as CPU resources, memory resources, or system resources.

2. Seek root and explore the system resource management mechanism

The instability of "jiu Wu" and "jiu ba" is well known, and the stability of Windows 2000/XP is much better. In fact, the root cause of Windows 9x instability is the management of system resources. Compared with Windows 2000/XP designed based on the NT kernel, Windows 95/98/ME using the Win9x kernel has completely different mechanisms for managing system resources.

1. Windows 9x

In Windows 9x, Microsoft divides system resources into five heaps, with three user resource heaps and two GDI resource stacks. The three user resource stacks are: 16-bit user heap with a size of 64 KB; 32-bit window heap with a size of 2 MB; 32-bit menu heap with a size of 2 MB. The two GDI resource stacks are: 16-bit GDI Heap with a size of 64 KB and 32-bit GDI Heap with a size of 2 MB. From the classification Type analysis, it is not difficult to find that there are two types: 16-bit and 32-bit. The reason why Windows 9x design system resources is as follows, this is to enable the old 16-bit program to run normally on the new operating system.

Use the GetFreeSystemResources function in the program to learn the details of system resources.

Set compatibility mode

Do you know the famous "Barrel Principle? If the length of the wooden board is different, the maximum capacity of the wooden barrel does not depend on the long wooden board, but on the shortest wooden board. The bucket principle is also applicable to available resources in the system. The principle is simple. When resources of a certain type can be allocated are exhausted, even if there are many other resources remaining, the system also has problems due to insufficient resources. Therefore, the available system resources must be smaller than the available user resources and the available GDI resources. To maintain compatibility with 16-bit applications, a large amount of data in Windows 9x occupies a 16-bit 64 kB Resource Heap, which is largely consumed first, the 64 kB Resource Heap instead of 2 MB Resource Heap is used to restrict system resources.




We should have understood that in Windows 9x, the system resources are fixed and have nothing to do with the hardware grade, whether your CPU is P4 or 486, the memory size is 8 MB or 1 GB. When you encounter a "system resource insufficiency" prompt, some old birds may prompt you to increase the memory. In fact, this experience is totally wrong. There are two main ways to solve the problem: first, reduce the number of programs running at the same time and release available system resources; second, restart the system to overcome the imperfect resource recovery mechanism, as a result, the availability of system resources decreases sharply, which is insufficient for normal operation.

How can I view the current system resource status? A dedicated tool is provided in Windows 9x for observation. Click Start Menu → program → attachment → System Tool → resource status to run the tool. If you cannot find the tool, you can choose to install it in the Windows component added/deleted.

2. Windows 2000/XP

In Windows 2000/XP, you will hardly encounter any prompts such as "insufficient system resources". The main reason is that Windows 2000/XP has no system resource size limit, the system automatically allocates enough system resources based on the actual running conditions. However, some old 16-bit programs may not work properly. For this reason, Microsoft provides the "compatibility mode" Operation Mode to simulate other versions of Windows on Windows 2000/XP, for example, Windows 95/98/Me/NT.

Having read so much, do you know more about "system resources? I hope this article will help you.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.