Analysis of the reason why Windows uses 1G memory is still slow

  
Now the memory has basically reached the average price of 1 yuan /MB, many friends' computers say goodbye to poor 64MB, 128MB memory, 256MB has become the standard configuration, 512MB or even 1GB of memory No longer "sensational." But there is one thing to make a lot of friends wondering: "? Why use 1G memory my Windows startup, software, speed or so slow" after

install large-capacity memory, system, process efficiency has not been greatly improved, This is because the operating mechanism of the system itself limits its ability to manage and utilize hardware resources. So even if the hardware resources are very rich, if it is beyond the scope of Windows management, the performance will not be significantly improved.



many memory and hard disk as they often confused with the physical memory and the hard drive, are used as both the MB or GB capacity of such units, indicating the physical memory and a hard disk The best analogy of the relationship is: a small office with a desk and a filing cabinet.

The file cabinet is like a hard disk. Programs and data can be stored there safely for a long time. The desktop represents physical memory, allowing people working on the desk (the same function as the processor) to be directly placed on the desktop. Any file (program and data). In order to operate on a particular file, you must first remove the file from the file cabinet and place it on your desktop. If the desktop is large enough, you can open multiple files on your desktop at the same time. Similarly, if you have more physical memory, you can run more or larger programs and process more or larger data.

to increase computer hard disk space is like putting a bigger file cabinet in the office, while adding more memory is like to get a bigger desk, you can simultaneously operate more programs and data.

a, so that Windows uses memory

want to know why the speed of the system upgrade is no longer obvious, you must first understand how Windows uses memory. Here is a concept - resources. This is not usually said

CPU resources, memory resources or a unified "system" resource. The "resources" we will talk about next are the Windows objects that the program can manipulate. For example, each window displayed on the screen is a resource, and each image can be a resource. If an application opens a file on disk, then the opened file is also a resource. By analogy, if an application needs to use a resource, it will make a request to the operating system to create a new one or call it from memory.

1. Scene Reproduction: Program and System Dialog

The program says: "Hey, Windows, I want to create a new 300 pixel wide, 200 pixel high window, ok?" So, Windows immediately creates or calls this resource as required. Into the memory, and then feedback to the application a code: "Well, I have created the window you want, its code is #38710." After that, when you need to use this new window, the application uses the Windows feedback code Represent this resource. "Windows, you are bothered to display #38710 in the upper left corner of the display screen." "Good!" Finally, when the application does not need to use the resource, it will ask Windows to remove the resource. "OK, please delete #38710." "Good!".

2. Pointer - City

memory then the code is generated based on what criteria it? In most operating systems, it is determined by something called a "pointer." You can think of the entire memory as a post office, and the postman sorts the letters that need to be sent to various places in a number of different mailboxes. Mailboxes one by one, occupying a wall. Each heart has a number of letters containing information to be sent to a particular area. Moreover, as if each region has a zip code, each memory space that can store data also has an address - a pointer. A string of numbers representing this storage space. The "pointer" of some part of the data in memory, that is, the address of the first memory space occupied by the data. So, if I am a normal operating system and have an application that asks me to call a window, I will call this window into memory as it tells me to ask if the address of this resource's data is stored in memory starting at # 1234567, then I will return a message to the application: "Okay, I called this window, it is #1234567."

3. Pointers to solve the problem

in the PC, this pointer is 4 bytes long. So if an application needs to allocate a pointer to a piece of data in memory, then it takes 4 bytes of memory. This way of working has brought a lot of trouble to the early Windows designers, because the production process is still not developed, the memory is very expensive, 8MB of memory on a computer is enough to let users laugh from their dreams countless times. Most computers can only be configured with 4MB of memory. In such a tight memory situation, an application often needs to use millions of resources. To use these resources, it is necessary to allocate a pointer to each resource. Each pointer occupies 4 bytes, and millions of pointers consume an objective amount of memory. This is like a small amount of money, but if you want to give the people of the country a dollar, it is at least 13 million yuan.

So, Windows designer uses another alternative. They created a resource table. It is to register the information of all resources currently transferred into memory to a list. In this way, when the application asks the system to call a resource, the system does not assign a pointer to the system after the call, but directly tells the application the serial number of the resource in the resource table. "Well, I have already called the resource you need. The serial number in the resource table is #383" because it is not a memory address, so you can use a number that only takes 2 bytes. This is just a two-byte gap. But when you only have a few megabytes of memory, and the program you run is calling a lot of resources, the difference between the two bytes will bring a big advantage.

Do you know?

Microsoft 64-bit operating systems do not play 1GB memory not

in 32 Windows 2000 /XP, the maximum support 4GB of memory, each application can only use a maximum of 2GB of memory, because The other half of the memory is also reserved for the system. In 64-bit Windows XP, this limitation is gone. Each program can fully use 4GB of memory. In addition to Windows, Microsoft is still developing 64-bit versions of SQL Server 2000 and Windows Server 2003, but to run these applications, you need your computer. At least 1GB of memory.

4. Passage of time, good ideas into defects

But this approach also has its drawbacks - two different digital bytes that can be expressed very limited

we can do an experiment: Please write different numbers . If you only allow you to write a single number, you can only write ten different numbers. If you limit the writing of two digits, although you can write more, the total is still limited. By analogy, the more digits allowed, the more different numbers can be written. But as long as there is a limit on the number of digits, the total number of different numbers written is always limited. Similarly, if the system is allowed to use a 4-byte serial number, then under this "digit limit", there can be billions of different serial numbers available. However, if only the system uses a 2-byte serial number, the available serial number will be reduced to 65,536. Therefore, the resource table we talked about above cannot be extended indefinitely. The serial number is only 65,536

The problem is coming. After calling 65,536 resources, I want to call more resources. Even if there is 1GB of memory, it is enough to store tens of billions of resources, but only 2 bytes of resource table can not generate more serial numbers! Without a serial number, it means that the resources cannot be distinguished, and the application naturally cannot use these resources without "accounts"! In fact, because no serial number is available, the system cannot call more than 65536 resources at the same time.

But in 10MB memory is wishful thinking of the era, to be called at the same time hundreds of thousands of resources is simply "nonsense." So the Windows designers at the time didn't take this question to heart, decisively chose the resource table and chose the 2-byte serial number.

today, the operating system be retribution. The memory is cheap, the resource table and the 2-byte serial number still save us memory space, but the disadvantages it brings far exceed the benefits it brings. We have enough memory space to call millions of resources, but there are only 65536 serial numbers in the resource table! So at the same time, there are only 65,536 resources in memory! Is there 1GB of memory available? Wait, then!

5. Who is the real "consuming resources"?

understand the above reasons, it is not difficult to distinguish in addition to large files, large programs, the real consumption of system resources is a program which:

★ call a large number of small resources, the Desktop Decorative bells and whistles software

★ Various multimedia player software

★ Monitoring system tool software

★ Can preview fonts in the font menu (such as MS Office when)

Further, running Windows 9x n /Me 16-bit program (e.g., DOS
program), Windows will be designated a memory for all such uses. This memory will not be released unless all 16-bit programs have been closed.

6. Where is the advantage of large memory? Do

large memory no effect yet? Memory manufacturers are cheating money? of course not. When an application is launched, some components of Windows are also started, which is very common. When the application is closed, Windows will keep those components closed, as it may be used soon. Similarly, a small amount of resources that are loaded into memory when the program starts will not exit the memory as the program closes.

At this time, large memory can sometimes reflected the positive. On the one hand, large memory can hold a large amount of data at one time, reducing the probability that the performance of the hard disk is not as good as that of the 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 remain in memory and not be cleared. Once you restart the program, you will find it significantly faster than when using small memory!



Second, the use of large memory ESSENCE

1. Turn memory into your hard drive

If your memory is really rich, you can use Microsoft's RAMDISK designed for Windows2000, which can virtualize part of the memory into a hard disk and virtualize the data that was originally saved on the hard disk. In memory. For example, put temporary files for Windows and temporary files for the Internet into this virtual disk. As we all know, the speed of memory 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, since the data is actually stored in the memory, the data will disappear after the shutdown. Therefore, it can enhance system security to a certain extent.

Step 1: Download RAMDISK from http://www.download.mocrosoft.com/download/win2000ddk/sample01/1/nt5/EN-US/ramdisk.exe
. Unzip it into a temporary folder, such as C:\\RAMDISK

Step 2: Click "Start è Settings è Control Panel", double-click to open "Add/Remove Hardware", then select "Add" /Exclude device failure" and click "Next button"; in the "Select a hardware device" window that appears, select the "Add new device" item, and then click the "Next" button; in the next window, select " No, I want to select the hardware from the list and click the "Next" button; then select "Other devices" in the "Hardware Type" list and click "Next"; click "From Disk" in the window that appears Install the "Button, copy the "manuscript file" in the "Install from Disk" window that pops up

Copyright © Windows knowledge All Rights Reserved