Analyze the causes of slow 1g memory usage in Windows

Source: Internet
Author: User
Tags sleep function

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,ProgramThe operating efficiency has not been 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 ", click "ramdisk driver" in the "model" list and click "Next". The "no digital signature found" dialog box appears in windows, click "yes.

Step 3: Open notepad, enter the text, and save it as ramdisk. Reg.

Windows Registry Editor Version 5.00

[Hey_local_machine \ System \ curentcontrolset \ servies \ ramdisk \ Parameters]

"Breakonentry" = DWORD: 00000000

"Debuglevel" = DWORD: 00000000

"Debugcomp" = DWORD: ffffffff

"Disksize" = DWORD: 01f00000

"Driveletter" = "R :"

"Rootdisponries" = DWORD: 00000200

"Sectorspercluster" = dowrd: 00000002

[HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Session Manager \ environment]

"Temp" = "R :\\"

"Tmp" = "R :\\"

[HKEY_CURRENT_USER \ environment]

"Temp" = R :\\"

"Tmp" = "R :\\"

[HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Shell Folders]

"Cache" = "R :\\"

[HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ User Shell Folders]

"Cache" = "R :\\"

[HKEY_USERS \. Default \ environment]

"Temp" = R :\\"

"Tmp" = "R :\\"

[HKEY_USERS \. Default \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Shell Folders]

"Cache" = "R :\\"

[HKEY_USERS \. Default \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ User Shell Folders]

"Cache" = "R :\\"

After that, double-click ramdisk. reg to import it to the Registry. The above registry data can be downloaded at www.cfan.com.cn.

Tips

The key in the ramdisk. reg file is as follows:

Parameters: Set the drive letter of ramkisk to R, and the size is 30.9 MB.

Session Manager \ environment: sets the system's temp and TMP environment variables to the Virtual Drive R.

Heky_current_user \ environmnet: sets the temp and TMP environment variables of the current user to the Virtual Drive R

Both hkcu Shell Folders: sets the Temporary Internet file of the current user to the Virtual Drive R.

Hky \. Default keys: Set the Default User's temp, TMP, and Internet temporary files to the Virtual Drive R

Step 4: Shut down and restart Windows2000.

Tips

Of course, the ramdisk function provided by Microsoft is relatively simple. At present, there are some more powerful memory virtual software on the Internet, such as ramdisk.

2. Modify the Registry to take advantage of large memory

Open the Registry Editor, find [HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ controlsession Manager \ momorymanagement], and modify the key value in the right pane (note that, the premise is that the memory should exceed 512 MB and be limited to Windows 2000/XP ).

(1) "largesystemcache" (enable a large system cache): opens up a large memory space in the memory for pre-read operations on the disk file system. When the program continuously requests more data, Windows uses the system cache to automatically pre-read the data so that the program can obtain the required data as quickly as possible. Enabling this system buffer will occupy a large amount of physical memory, reducing the available physical memory that can be used by the program. Set the value to 1. In this way, the system cache is increased from 4 MB to 8 Mb.

(2) "secondleveldatacache" (improves CPU performance): the CPU processing speed is much faster than the memory access speed, and the memory is much faster than the hard disk. In this way, the performance bottleneck is formed between the CPU and memory, and the memory and disk. The previous "largesystemcache" was designed to alleviate the memory and disk bottlenecks, in order to quickly obtain and process data from the memory, the CPU also sets a buffer mechanism L2 cache (second-level cache ). By adjusting this key value, Windows can better use the cache mechanism with the CPU to achieve a higher data pre-read hit rate. We recommend that you set it to 512.

(3) disablepagingexecutive (disable page files): change the value to 1 (hexadecimal), which will limit all programs and data to physical memory, instead of using virtual memory. Obviously, when there is enough physical memory to complete the required tasks, this will greatly improve the system performance. For users with only 64 MB of memory, enabling it may be a disaster-frequent system errors until they crash.

(4) "iopagelocklimit" (custom input/output buffer size): the input/output system is the channel for data transmission between the device and the microprocessor, data transmission is smoother when the buffer size is expanded. Similarly, the size of the specific settings depends on the size of the physical memory and the number of running tasks. Generally, if the memory has 64 MB, you can set the hexadecimal value of the double-byte key to 400 (1 MB), 800 (2 MB), or 1000 (4 MB) 1000 MB memory can be set to 2000 (4 MB), 4000 (8 Mb), or 4000 (16 Mb); 8000 (16 Mb) or (32 MB ). Of course, if you have more memory, you can set it to 10000 (64 MB) or more. If it is set to 0, Windows will automatically configure it.

Tips

It is said that this setting can effectively solve the problem of BT downloading damaged disks.

3. Can I use 1 GB of memory for Windows98/me?

Windows 98/me does not support memory larger than 1 GB. At the same time, after the memory exceeds MB, special adjustments are required for the system to better manage and use the memory, and avoid system faults caused by large memory. All key settings are centered on vcache (Virtual High-Speed memory ).

Do you know?

What is vcache?

It is the physical memory allocated by windows for the hard disk as a high-speed buffer, which can greatly improve the read/write speed of the hard disk, similar to the usage of smartdrv in DOS. To put it simply, vcache is a space automatically allocated by windows in the physical memory. It is used to save previously used space and Windows considers it to be used again.CodeAnd data, so when the new program requires the use of the code and data, it does not have to read from the hard disk, but directly read from the memory, this speed will be much faster, this greatly improves the system performance.

(1) MB ~ 512 MB

According to experts, if the memory is MB ~ 512 MB. use NotePad to open C: \ WINDOWS \ SYSTEM. INI searches for the [vcache] section, finds a row starting with "maxfilecache =", and sets its value to 70% of the physical memory (because the value here is in KB, use the formula MB * 1024 or Bytes/1024 to convert data. For example, if your memory is 128 MB, it should be 128*0.7*1024 = 91750.4 (about 91750kb). This statement should be written as "maxfilecache = 91750"

(2) memory above MB

Some may find that when the memory is increased to MB or above, when Windows98/me is started or the DOS window is opened, the system will prompt "insufficient memory ".

This is mainly because Windows 98/me has a defect in Processing Memory larger than 512 MB. Therefore, it is best to set the maxfilecache value of vcache to 524,288 MB (524288 KB), that is, "maxfilecache = ".

(3) 1 GB memory

If the memory size reaches 1 GB or higher, Windows 98/me may experience continuous restart, crash, or Windows Update failures.

To solve this problem, open the system. ini file and add "maxphyspage = 40000" in the [paiehh] field ". In this way, the Windows READ memory can be limited to less than 1 GB.

If you cannot enter windows, press Ctrl until the Start menu appears, select "command prompt only", and enter "edit system. ini ", Press enter, and then add" maxphyspage = 40000 "in the [paiehh] field ".

4. Disable sleep

Many users like the sleep function to enable fast boot. However, for computers with large memory, it is best to disable the hard disk sleep function when hard disks are not frequently read or written, this is because sometimes it causes a crash for no reason.

5. Can I leave virtual memory out of the memory?

I often see manyArticleIntroduction: you can disable the virtual memory when there is a large memory. Not actually! For example, Windows 98/me has inherent limitations on memory larger than MB. If the memory is larger than this quantity, Windows 98 may experience instability and slow startup speed. If you use large memory and disable virtual memory, the unstable factor will be further increased.

In addition, Windows is designed to map the memory space allocated to a process to the swap file once a process is found to be inactive, try to empty the physical memory for other active processes, instead of using the physical memory to start using swap files. It would be too late to call the API when the physical memory is used up. Data transmission and processing will inevitably stagnate on low-level computers. Therefore, the prohibition of virtual memory is, in principle, the most vulnerable to Windows exceptions. If you do not encounter any faults that cannot be run in a timely manner, the system will frequently prompt that the virtual memory is insufficient. Please reset the cloud.

Do you know?

According to Asus experts, when using the Intel 850/850 e chipset motherboard, if it is equipped with 2 GB Rambus memory, the computer will be unstable. This is due to the limitation of the intel850/850e chipset. Intel recommends: memory size * The number of chips in each memory is less than or equal to 24. At present, the number of chips for Rambus 256 memory sold in China is 8, and the number of chips for rambus512mb memory is 16. Therefore, when users use a large amount of memory, there may be instability.

6. enable large memory to power Hard Disks

if you have more than MB of memory and a maxcompute or kunteng hard disk, maxboost launched by maxtor is worth a try. It is said that it can greatly improve the hard disk performance, the disk performance can be improved by up to 60%. The software is actually a disk drive, replacing the disk drive of Windows/xp. It can automatically set a suitable size cache in the system memory for different application software, reads and writes data in advance as a pre-read and buffering function. The disk reads and writes data in a manner that does not disclose technical details. Advanced algorithms ", in this way, the read/write speed of the hard disk can be effectively improved to improve the speed of applications and systems. According to some experts, although the software is not as magical as it was officially claimed, it did show its talents in operations such as file copying. Of course, maxboost is still in the testing stage, so there are still some problems, so it is recommended that general players use the software after it is officially launched.

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.