Analyze the causes of slow 1g memory usage in Windows

Source: Internet
Author: User

Source: eNet

The current memory has basically reached the average price of 1 yuan/MB, many friends say goodbye to the poor 64 MB, MB memory, MB has become a standard preparation, MB or even 1 GB of memory is no longer "sensational ". But there is one thing that many may wonder: "Why is my Windows startup and software running so slow with 1 GB of memory? "

After large-capacity memory is installed, the system and program running efficiency are not significantly improved because the system's operating mechanism limits its ability to manage and use hardware resources. Therefore, even if the hardware resources are very rich and beyond the scope of Windows Management, the performance will not be significantly improved.

Memory and Hard Disk

Many cainiao often confuse physical memory and hard disk, because the capacity of the two is expressed in MB or GB units. The best metaphor for the relationship between physical memory and hard disk is: a small office with a desk and a file cabinet.

File cabinets are like hard disks where programs and data can be stored securely for a long time. desktops represent physical memory and allow people who work on their desks (act the same as processors) directly use any files (programs and data) on the desktop ). To operate a specific file, you must first retrieve the file from the file cabinet and put it on the desktop. If the desktop is large enough, you can open multiple files simultaneously on the desktop. Similarly, if you have more physical memory, you can run more or larger programs and process more or larger data.

Adding a hard disk space to a computer is like placing a larger file cabinet in the office, and adding more memory is better than a larger desk, allowing you to operate more programs and data at the same time.

1. Use memory like Windows

To learn why the system speed improvement is no longer obvious, you must first understand how Windows uses memory. A concept-resource is involved here.

This is not commonly referred to as CPU resources, memory resources, or unified "system" resources. The "resource" we will talk about next is a Windows object that can be manipulated by a program. For example, each window displayed on the screen is a resource, and each image can also be a resource. If an application opens a file on the disk, the opened file is also a resource. Similarly, if an application needs to use a resource, it will request the operating system to create a new resource or call it from the memory.

1. Scenario reproduction: a dialogue between a program and a system

The program said, "Hi, Windows, I want to create a window with a width of 300 pixels and a height of 200 pixels. OK? "So, Windows immediately creates or calls this resource into the memory as required, and then sends a code to the application:" Well, I have created the window you want, its code is #38710. "Later, when you need to use the new window, the application uses the Code provided by Windows to represent this resource. "Windows, please show #38710 in the upper left corner of the screen. "" Good! "Finally, when the application does not need this resource, it will require Windows to remove this resource. "OK, please delete #38710. "" Good! ".

2. Pointer -- zip code in memory

So what standards are the codes based on? In most operating systems, it depends on something called a pointer. You can think of the entire memory as a Post Office. The Postman sorts the mails that need to be sent to different places and puts them in many different mailboxes. The mailbox occupies a wall. Each heart contains letters containing the information to be sent to a specific region. In addition, just as each region has a zip code, each memory space that can store data also has an address-pointer. Represents a string of numbers in the bucket. The "Pointer" of some data in the memory, that is, the address of the first memory space occupied by the data. Therefore, if I am a common operating system and an application requires me to call a window, I will call the window to the memory according to the requirements it tells me, if the address where the data of this resource is stored in the memory starts at #1234567, I will return a message to the application: "Okay, I called out this window, it is #1234567. "

3. Solve pointer Problems

In PC, this pointer has four bytes in length. Therefore, if an application needs to assign a pointer to a data in the memory, it needs 4 bytes of memory space. This kind of work method brought a lot of trouble to early Windows designers, because the production process was not developed yet and the memory was very expensive, 8 MB memory on a computer is enough to make users laugh and wake up countless times. Most computers can only prepare 4 MB memory. When the memory is so tight, an application often needs millions of resources. To use these resources, assign a pointer to each resource. Each pointer occupies 4 bytes, and millions of pointers consume a certain amount of objective memory space. This is much less than a copy of the money, but if you want to send a copy of the money to people across the country, it will be at least 13 million yuan.

Therefore, Windows designers adopt another alternative. They created resource tables. It is to register the information of all resources currently transferred into the memory to a list. In this way, when the application requires the system to call a resource, the system will not assign a pointer to it after calling, but directly tell the application the serial number of the resource in the resource table. "Well, I have called the resource you need. The serial number in the resource table is #383" because it is not a memory address, therefore, it can be represented by a number that only occupies 2 bytes. This is only the gap between two bytes. However, when you only have a few MB of memory and the program you run calls a large number of resources, the gap between the two bytes will bring a great advantage.

Do you know?

Microsoft 64-bit operating system does not have 1 GB of memory.

In 32-bit Windows 2000/XP, a maximum of 4 GB of memory is supported. Each application can only use 2 GB of memory, because the other half of the memory is reserved for the system. In 64-bit Windows XP, this limit is absent. Each program can use 4 GB of memory completely. In addition to Windows, Microsoft is also developing 64-bit versions of SQL Server 2000 and Windows Server2003, however, to run these applications, your computer must have at least 1 GB of memory.

4. Time-and-time migration is a flaw

However, this method also has its drawbacks-two bytes can represent very limited numbers

We can make an experiment: Please write different numbers. If you write only one digit, you can write only 10 different numbers. If double-digit writing is restricted, although more can be written, the total number is still limited. Similarly, the more digits allowed, the more different numbers can be written. However, as long as the number of digits is limited, the total number of different numbers written is always limited. Similarly, if the system is allowed to use a 4-byte serial number, there may be several billion different serial numbers under this "number limit. However, if only the system uses a 2-byte sequence number, the number that can be used will be reduced to 65536. As a result, the resource table we mentioned earlier cannot be infinitely lengthened. A maximum of 65536 serial numbers can be entered.

The problem arises. After 65536 resources are called, you can call more resources, even if the memory space is 1 GB, which is sufficient to store tens of billions of resources, however, a resource table with only 2 bytes cannot generate more serial numbers! Without the serial number, it means that resources cannot be separated, and applications cannot use resources without "accounts! In fact, because no serial number is available, the system cannot call more than 65536 resources at the same time.

However, in an era where 10 MB of memory is a luxury, it is "nonsense" to call hundreds of thousands of resources at the same time ". So at that time, the Windows designers did not care about this problem. They chose the resource table and the 2-byte sequence number.

Today, the operating system is rewarded. The memory is cheaper. The resource table and the 2-byte serial number still save the memory space, but the disadvantage is far greater than the benefits it brings. We have enough memory space to call millions of resources, but the resource table contains only 65536 serial numbers! Therefore, at the same time, the memory can only have 65536 resources! Is there 1 GB memory available? Wait!

5. Who is the real "resource consumption?

After understanding the above principles, it is not difficult to tell which programs actually consume system resources apart from large files and large programs:

★Call a large number of small resources to decorate the desktop.

★Various multimedia playback software

★Tool Software for monitoring systems

★Apps that can preview fonts in the font menu (such as MS Office)

In addition, when running a 16-bit program (such as a DOS program) in Windows 9x n/Me, Windows will allocate a piece of memory for all such programs. This memory will not be released unless all 16-bit programs are closed.

6. What are the advantages of large memory?

Does large memory have no function? The memory vendor is swindling money? Of course not. When an application is started, some components of Windows are also started, which is very common. When the application is disabled, Windows retains those components, because they may be used soon. Similarly, a few resources are called into the memory when the program is started, and the memory will not exit as the program is closed.

At this time, the large memory is sometimes reflected. On the one hand, large memory can accommodate a large amount of data at a time, reducing the chance of using hard disks that are far inferior to memory as virtual memory, and improving the data calling speed. On the other hand, after the program is closed, more common data will have enough space to be retained in the memory. Once you restart the program, you will find that it is much faster than using small memory!

Ii. High memory usage

1. Change the memory to your hard disk

If your memory is rich, you can use the RAMDISK specially designed by Microsoft for Windows2000. It virtualizes some memory into a hard disk and virtualizes the data originally stored in the hard disk into the memory. For example, you can place Windows temporary files and Internet temporary files in this virtual disk. As you know, the memory speed is much faster than the hard disk speed, which can greatly improve the data reading speed and make Windows run more efficiently. At the same time, because the data is actually stored in the memory, therefore, after shutdown, the data will disappear, so the system security can be enhanced to a certain extent.

Step 1: slave. And decompress it to a temporary folder, such as C: RAMDISK

Step 2: click "è é settingé control panel", double-click to open "Add/delete Hardware", select "Add/Remove device fault", and click "Next "; in the displayed "select a hardware device" window, select "Add new device" and click "Next". In the following window, select "no, select hardware from the list and click "Next". Then, select other devices in the "Hardware type" list and click "Next "; in the window that appears, click "Install from disk". In the displayed "Install from disk" window, set "vendor file copy source" to "c: RAMDISK ", after confirmation, the selection window appears. Select the Ramdisk Driver option in the "model" list and click "Next ".

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.