Our Latest News

Will adding more memory make your computer faster?

First of all, executable programs are stored on disk (or other media, of course) and actually contain two main parts: the machine instructions and the data on which the instructions depend.

When the program is run, it is first loaded into memory, and the program that is loaded into memory becomes what we call a process, but of course, there is another special program running in memory: the operating system.

Only when the CPU actually executes the machine instructions does the corresponding process start to run, when the CPU continuously takes instructions out of memory and executes them, and of course, in addition to the machine instructions, it also needs to read the data in memory.

As you can see, when the program is running, the CPU interacts with the memory instead of the disk, the memory stores instructions and data, and the CPU uses the instructions and data, so from this point of view it is a similar producer-consumer problem, the memory is like the chef, the CPU is like the diners, if the chef is too slow to serve then the diners will be hungry.

In addition, the use of memory by the operating system cannot be ignored.

How does the operating system utilize memory?
There are many clever designs in modern operating systems to make the best use of memory and disk resources.

Since the CPU can only run one program at a time, even in multi-core systems there are generally more processes than cores at the same time, which means that not all programs are running at a given time, and even for running processes there are always some instructions or data in the process address space that are temporarily unused due to the principle of locality.

Based on this, operating system pioneers saw the opportunity to make full use of memory, we can put the temporarily unused instructions or data to disk (swap out), and then load them from disk to memory when they are used (swap in), so that there is more space in memory to run more processes. This idea is called demand paging in the operating system, and is part of virtual memory.

Translated with www.DeepL.com/Translator (free version)

Second, the operating system will use the remaining free memory as disk cache. Sometimes when the system load is low our programs do not make full use of the memory, so is this free memory really useless? Obviously not. We know that disk is a low-speed storage device, so why not use the free physical memory as a disk cache?

We all may have this experience, when you start to open a brand new file usually slow, but when you use the file again will obviously feel the speed will be much faster, the principle behind this, if your memory is not enough at this time, then the operating system will not have so much free memory to be used as a disk cache, at this time you will really experience the snail-like speed of the disk.

Translated with www.DeepL.com/Translator (free version)

Now we are ready to answer the question posed at the beginning, will increasing memory speed up the computer? Obviously this is divided into two cases to discuss.

Sufficient memory
If your memory itself is sufficient, then in this case adding more memory will not make your computer run faster , because the CPU as a diner eats at a finite speed, and there is no way you can make the diner eat any faster if the chef cooks more.

It’s like asking if putting more wheels on a truck will make the car go faster?

The answer is obviously no, although it doesn’t make the truck go faster, but adding more wheels will make the truck have a higher load.

The same is true for memory. Even though adding more memory doesn’t make a computer go faster, it will obviously allow us to run more programs at the same time.

Adding more memory means you can open more browser pages at the same time, you can open more virtual machines at the same time, render more HD video at the same time, work on more complex 3D models at the same time, train more machine learning models at the same time, etc. At this point your memory is not the bottleneck, the CPU will likely be the bottleneck because the CPU is running at a finite speed, i.e., the number of machine instructions executed within each second.

Insufficient memory
At this point the chef is serving food too slowly and the diners are always hungry, so the chef needs to serve more food.

As we know, most programs request memory frequently during operation. Requesting memory is a seemingly simple but actually very complex operation, especially in a system memory shortage scenario, when requesting memory often involves more complex lookups or exception handling, and our programs will run significantly slower.

When memory is low, there may be more swapping between disk and memory, and the system speed will be limited by the disk, and since the disk files cannot be cached, we will be able to open processes or files significantly slower.

Adding more memory in this case will feed the CPU better and therefore will significantly speed up the computer.

In summary
From the above analysis, we know that the question of whether increasing memory can speed up your computer depends on your scenario. If your device has sufficient memory, then increasing memory will not significantly speed up your computer at this point.

Reviewed and edited by Qing Liu

    GET A FREE QUOTE

    FPGA IC & FULL BOM LIST

    We'd love to

    hear from you

    Highlight multiple sections with this eye-catching call to action style.

      Contact Us

      Exhibition Bay South Squre, Fuhai Bao’an Shenzhen China

      • Sales@ebics.com
      • +86.755.27389663