What is computer memory? How big is the memory? What's the impact of less memory? How to improve memory?

internal storage

In the structure of a computer, there is a very important part, that is, memory. Memory is a component used to store programs and data. For a computer, only with memory can it have memory function and can it work normally. There are many kinds of memories, which can be divided into main memory and auxiliary memory according to their uses. Main memory is also called memory (memory for short). Memory plays an important role in the computer. Memory generally uses semiconductor memory cells, including random access memory (RAM), read-only memory (ROM) and cache. Just because RAM is the most important memory. S(synecronius)DRAM synchronous dynamic random access memory: SDRAM is 168 pin, which is the memory used by Pentium and above models at present. SDRAM locks CPU and RAM together through the same clock, so that CPU and RAM share a clock cycle and work synchronously at the same speed. The rising edge of each clock pulse starts to transmit data, which is 50% faster than EDO memory. DDR (Double Data Rage) RAM: an updated product of SDRAM, which allows data transmission at the rising and falling edges of clock pulses, so that the speed of SDRAM can be doubled without increasing the clock frequency.

● Memory

Memory is the place where programs and data are stored. For example, when we use WPS to process documents, when you enter characters on the keyboard, it will be stored in memory. When you choose to save, the data in the memory will be stored on the hard (magnetic) disk. Before we know it further, we should also know its physical concept.

● Read-only memory (ROM)

ROM stands for read-only memory. When manufacturing ROM, information (data or programs) is permanently stored and preserved. This information can only be read, but generally cannot be written. Even if the machine is powered off, data will not be lost. ROM is generally used to store basic computer programs and data, such as BIOS ROM. Its physical appearance is usually a DIP integrated block.

● Random Access Memory (RAM)

Random access memory means that data can be read and written from it. When the machine loses power, the data stored in it will be lost. The memory chips we usually buy or upgrade are used as the memory of the computer. Memory stick (SIMM) is a small circuit board that gathers RAM integrated blocks together. It is inserted into the memory slot of a computer to reduce the space occupied by RAM integrated blocks. At present, there are128m/piece, 256m/piece, 512m/piece and so on in the market.

Low speed cache (cache)

Cache is also a concept that we often encounter. It is located between CPU and memory, which is a kind of memory with faster reading and writing speed than memory. When the CPU writes or reads data into the memory, these data are also stored in the cache. When the CPU needs these data again, the CPU will read the data from the cache instead of accessing the slow memory. Of course, if the required data is not in the cache, the CPU will read the data in the memory again.

When you understand the above concepts, you may ask, memory is memory. Why are there all kinds of memory terms? What is this?

Before answering this question, let's take a look at the following passage.

Physical memory and address space

Physical memory and storage address space are two different concepts. However, due to the close relationship between the two, and the capacity is measured by B, KB, MB and GB, it is easy to be confused in understanding. Beginners understand these two different concepts, which is helpful to further understand memory and make good use of it.

Physical memory refers to a specific memory chip that actually exists. For example, the memory stick inserted in the motherboard and the ROM chip loaded with the system BIOS, the display RAM chip on the graphics card and the ROM chip loaded with the display BIOS, and the RAM chip and ROM chip on various adapter cards are all physical memories.

Memory address space refers to the range of memory coding (coded address). The so-called coding is to assign a number to each physical storage unit (a byte), which is usually called "addressing". The purpose of assigning a number to a storage unit is to facilitate searching and complete data reading and writing, which is called "addressing" (therefore, it is also called address space).

The size of the address space and the size of the physical memory are not necessarily equal. Let's take an example to illustrate this problem: there are 17 rooms on a certain floor, and their numbers are 80 1 ~ 8 17. This 17 room is a physical object, and its address space is coded by three digits, ranging from 800 to 899 * * *100 address, which shows that the address space is larger than the actual number of rooms.

For microcomputers above 386, the address bus is 32 bits, so the address space can reach 232, which is 4GB. But in fact, the physical memory we configure is usually only 1MB, 2MB, 4MB, 8MB, 16MB, 32MB, etc. , far less than the range allowed by the address space.

Ok, now we can explain why there are different memory types, such as regular memory, reserved memory, upper memory, high-end memory, extended memory and extended memory.

Various memory concepts

What needs to be clear here is that the different concepts of memory we discuss are all based on addressing space.

The CPU of the first PC introduced by IBM is an 8088 chip with only 20 address lines, that is, its address space is 1MB.

PC designers use the low-end 640KB of 1MB as RAM for DOS and applications, and the high-end 384KB is reserved for ROM, video adapters and other systems. Since then, this boundary has been determined and is still in use today. The low-end 640KB is called conventional memory, which is the basic RAM area of PC. The low 128KB in the reserved memory is the display buffer, the high 64KB is the system BIOS space, and the remaining 192KB is reserved. According to the corresponding physical memory, only 5 12KB chips are used in the basic memory area, and 5 12KB addresses are occupied from 0000 to 80000. Although the display storage area has a space of 128KB, the monochrome display (MDA card) only needs 4KB, so only a 4KB physical memory chip is installed, occupying 4KB from B0000 to B 10000. If you use a color display (CGA card), you need to install 16KB of physical memory, and it takes up 16KB of physical memory from B8000 to BC00.

At that time (from the end of 1980 to the beginning of 198 1), such a "large" capacity of memory seemed to be enough for PC users, but with the continuous increase of programs, the continuous enrichment of images and sounds, and the emergence of new CPU that can access more memory space, the limitations of the original PC and MS-DOS design became more and more obvious.

1. What is extended memory?

Working principle of EMS

Shortly after 1984, that is, 286 was generally accepted, people became more and more aware that the 640KB limit had become an obstacle to large-scale programs. At this time, Intel and Lotus, two outstanding representatives of software and hardware, jointly developed a scheme combining software and hardware, which made it possible for all PCs to access more than 640KB of RAM. Microsoft just launched Windows, which has a high demand for memory space, so it joined the ranks in time.

1985, Lotus, Intel and Microsoft defined LIM-EMS, that is, extended memory specification, which is usually called EMS as extended memory. At that time, EMS needed to install a memory expansion card and an extended memory manager named EMS in the I/O slot. But the address line of I/O slot is only 24 bits (ISA bus), which is not suitable for 32-bit computers above 386. So memory expansion cards are rarely used now. At present, the extended memory in microcomputer is usually simulated or used by EMM386 and other software under DOS. So the difference between extended memory and extended memory is not the location of its physical memory, but the method used to read and write. It will be further introduced below.

As mentioned earlier, extended memory can also be converted from extended memory simulation. The principle of EMS is different from that of XMS, which adopts page frame mode. A page frame is a 64KB space specified in 1MB space (usually in the reserved memory area, but its physical memory comes from extended memory), and it is divided into four pages, each with 16KB. EMS memory is also paged according to 16KB, and 4 pages can be exchanged at a time, so that all EMS memory can be accessed. There are many EMS-compliant drivers, such as EMM386.EXE, QEMM, TurboEMS, 386MAX, etc. EMM386.EXE exists in both DOS and Windows.

2. What is extended memory?

As we know, 286 has a 24-bit address line, which can address the address space of 16MB, while 386 has a 32-bit address line, which can address the address space up to 4GB. In order to distinguish, we call the address space above 1MB as extended memory XMS(eXtend memory).

There are two working modes of microcomputer memory above level 386, one is called real address mode or real mode, and the other is called protection mode. In real mode, the physical address still uses 20 bits, so the maximum addressing space is 1MB to be compatible with 8086. The protection mode adopts 32-bit physical address, and the addressing range can reach 4GB. DOS system works in real mode, and the managed memory space is still 1MB, so it cannot directly use extended memory. For this reason, Lotus, Intel, AST and Microsoft have formulated the use standard of extended memory in MS-DOS, that is, the extended memory specification XMS. Himem.sys, which we often see in the Config.sys file, is the driver for managing extended memory.

Extended memory management specification appeared later than extended memory management specification.

3. What is a high memory area?

In real mode, the address of the storage unit can be recorded as:

Segment address: offset within segment

Usually written in hexadecimal XXXX:XXXX. The actual physical address is formed by shifting the segment address to the left by 4 bits and adding it to the intra-segment offset. If the address is 1, it is FFFF:FFFF. Its actual physical address is: fff0+ffff =10fef, which is about 1088KB (less 16 bytes), which has exceeded the range of 1MB and entered the extended memory. This area into the extended memory is about 64KB, which is the first 64KB space above 1MB. We call it HMA(High Memory Area). The physical memory of HMA is obtained from extended memory. Therefore, in order to use HMA, there must be a physical extended memory. In addition, the establishment and use of HMA need the support of XMS-driven HIMEM. SYS, so HMA can only be used after loading himem.sys

4. What is upper memory?

In order to explain the concept of upper memory, we must review the reserved memory area. The reserved memory area refers to the area of 640 KB ~ 1024 KB (* * * 384 KB). This part of the area was clearly reserved for the system when the PC was born, and the user program could not intervene. But this part of the space is not fully utilized, so everyone wants to make an idea of using the rest in an address space (note: it is an address space, not a physical memory). So you get another memory area UMB.

UMB (upper memory block) is called upper memory or upper memory block. It is caused by occupying the remaining unused space in the reserved memory, its physical memory is still taken from the physical extended memory, and its management driver is EMS driver.

5. What is shadow memory?

For careful readers, you may also find a problem: how to use 640 KB ~ 1024 KB physical memory for machines with physical memory above 1MB? Because this part of the address space has been allocated to the system, it cannot be reused. In order to make use of this part of physical memory, relocation function is provided in some 386 systems, that is, the address of this part of physical memory is relocated to 1024 KB ~ 1408 KB. In this way, this part of physical memory becomes extended memory, which can of course be used. But now the high-end computers no longer use this relocation function, and this part of physical memory is reserved for shadow ram. The shadow memory can occupy the same address space as the corresponding ROM. Shadow consists of RAM, which is much faster than ROM. When the contents of rom (various BIOS programs) are loaded into Shadow RAM with the same address, BIOS can be accessed from RAM without accessing ROM. This will greatly improve the system performance. Therefore, when setting CMOS parameters, the corresponding shaded area should be set to enable.

6. What is parity?

Parity check (ECC) is a way to correct data errors in data transmission, which is divided into parity and parity.

If odd parity is used, an extra bit is added as a parity bit when each byte is transmitted. When the number of "1" in the actual data is even, the parity bit is "1", otherwise the parity bit is "0", so that the transmitted data can meet the requirements of odd parity. After receiving the data, the receiver will detect the number of "1" in the data according to the requirements of odd parity. If it is odd, it means that the transmission is correct, otherwise it means that the transmission is wrong.

The process of parity check is the same as odd check, except that the number of "1" in the detected data is even.

summary

After the above analysis, the division of memory can be summarized as follows:

● The basic memory occupies 0 ~ 640 KB address space.

● The reserved memory occupies 640 KB ~ 1024 KB address space. Allocated to display buffer memory, ROM on each adapter card and system ROM BIOS, and the remaining space can be used as upper memory UMB. UMB's physical memory is taken from physical extended memory. This range of physical RAM can be used as shadow RAM.

● UMB is established by using the unallocated address space in reserved memory, and its physical memory is obtained by physical expansion memory. UMB is managed by EMS, and its size can be set by EMS driver.

● The first 64KB area in ●HMA extended memory (1024 KB ~ 1088 KB). Established and managed by HIMEM. System copy command (short for system)

●XMS memory conforms to the extended memory area managed by XMS specification. Its driver is HIMEM. System copy command (short for system)

● The memory conforms to the extended storage area managed by EMS specification. Its driver is EMM386.EXE, etc.

virtual memory

Memory plays a great role in the computer. All running programs in the computer need to be executed through memory. If the programs executed are large or many, the memory will be exhausted. In order to solve this problem, virtual memory technology is used in Windows, that is, a part of hard disk space is used as memory. When the memory runs out, the computer will automatically call the hard disk as memory to relieve the memory tension. For example, if the computer only has 128MB of physical memory, it is necessary to use a relatively large virtual memory when reading a file with a capacity of 200MB. After the memory reads the file, it will be stored in the virtual memory first, and then the file stored in the virtual memory will be released to the original installation directory. Let's see how to set up virtual memory.

Settings of virtual memory

Virtual memory has two main settings, namely, memory size and paging position. Memory size is the minimum and maximum virtual memory. Paging location is to set which partition of hard disk space virtual memory should use. How to get the minimum and maximum memory size settings? You can choose Start → Programs → Accessories → System Tools → System Monitor (if it is not available in the system tools, you can install it through Add/Remove Programs in Windows installer), then choose Edit → Add Project, select Memory Manager in the type item, and select the swap file size in the list on the right. In this way, with your operation, the fluctuation of the exchange file value will be displayed. You can open the programs you often use and then use them. At this point, check the performance value in the system monitor. Because the user's situation is different every time he uses the computer, it is best to monitor the exchange files for a long time and find out the most suitable value to ensure the stable performance of the system and keep the best state.

After finding out the most suitable range value, when setting virtual memory, right-click My Computer, select Properties to pop up the system properties window, select the Performance tab, click the Virtual Memory button below to pop up the virtual memory setting window, click the user-specified virtual memory setting radio button, select the partition with large remaining space on the hard disk, and then click Minimum to pop up the virtual memory setting window. If you find it a little troublesome to get the maximum and minimum values with the system monitor, you can select "Let Windows manage virtual memory settings" here.

Adjust paging position

The virtual memory paging location of Windows 9x is actually a virtual memory file (also called swap file) Win386.swp stored in the root directory of drive C, and its storage location can be any partition. If the capacity of system disk C is limited, we can transfer Win386.swp to another partition by opening the file system.ini (C: \ Windows C: \ Windows) in Notepad. In the [386Enh] section, change "Paging Drive = c: Windows Win386.swp" to the path of other partitions. If the exchange file is placed in D:, change it to "PagingDrive=D:Win386.swp". If there is no such statement, you can type it directly.

For users who use Windows 2000 and Windows XP, you can select Settings → Advanced → Changes in Control Panel → System → Performance to open the virtual memory settings window. By default, select the partition where the system is located in the drive [volume label]. If you want to switch to another partition, you must first set the original partition as a non-paging file, and then select another partition.

In other words, WinXP generally requires physical memory to be above 256 mm. If you like to play large 3D games and the memory (including video memory) is not large enough, the system will often prompt that there is not enough virtual memory, and the system will automatically adjust (virtual memory is set to system management).

If your hard disk space is large enough, you can also set up your own virtual memory. The specific steps are as follows: right-click my computer → Properties → Advanced → Performance Settings → Advanced → Virtual Memory Change → Select the partition for storing virtual memory (page file) → Customize the size → Determine the maximum and minimum values → Set. Generally speaking, virtual memory is 1.5 times or a little larger than physical memory. If you don't want to change the virtual memory frequently, you can set the maximum and minimum values to be the same.

44 "Virtual Memory Use Skills"

Microsoft provides us with an official solution on how to set up virtual memory. Generally speaking, we recommend the following setting methods:

(1) Set a page file in the partition where the Windows system is located. The size of the file is determined by your system settings. The specific setting method is as follows: Open the Properties setting window of My Computer, switch to the Advanced tab, and in the "Write Debugging Information" column of the "Startup and Fault Recovery" window, if "None" is used, set the page file size to about 2MB, and if "Core Memory Storage" and "Full Memory Storage" are used, set the page file value to be larger.

Tip: There is a contradiction whether to set the page file in the system partition: if it is set, the system may read this part of the page file frequently, thus increasing the load of the track where the system disk is located. However, if it is not set, when there is a blue screen of death (especially a STOP error) in the system, the dump file (Memory.dmp) cannot be created, so that it is impossible to debug the program and report an error. So the compromise is to set a smaller page file on the system disk, as long as it is enough.

(2) Establish a blank partition separately, and set virtual memory in this partition. The minimum value is set to 1.5 times physical memory, and the maximum value is set to 3 times physical memory. This partition is dedicated to storing page files and should not store other files. The reason why a separate partition is used to set up virtual memory is mainly based on two considerations: first, because there are no other files on the partition, the partition will not produce disk fragments, which can ensure that the data reading and writing of page files are not interfered by disk fragments; Second, according to the memory management technology of Windows, Windows will give priority to partitions that are not frequently accessed.

Page file, which also reduces the chances of reading the page file in the system disk and reduces the pressure on the system disk.

(3) Other hard disk partitions do not set any page files. Of course, if you have multiple hard disks, you can create a page file for each hard disk. When the information is distributed on multiple page files, the hard disk controller can read and write to multiple hard disks at the same time. In this way, the system performance can be improved.

Tip:

The minimum virtual memory allowed is 2MB, and the maximum virtual memory cannot exceed the remaining space of the current hard disk, and at the same time, it cannot exceed the memory addressing range of 32-bit operating system -4GB.