Memory intensive applications or applications that require a lot of memory are restricted by:
- Speed of RAM outside the processor
- Speed of cache inside the processor
- Number of entities sharing the
memory bus
- Virtual Memory
Unfortunately, these limitations are not major players in a program's performance. Bigger effects are: Quantity of CPUs, I/O operations and other tasks running with your program. Changing these items will impact your program more than changing items that affect memory bandwidth.
1. Speed of RAM outside the processor
The processor must go outside of its shell and grab instructions and data from RAM. RAM has different speeds at which it can access the cells and return the bits back to the processor. Generally, this is marked in units of Hz. The faster the memory, the less time your process spends load instructions and data and the faster your program executes.
Note: Increasing the speed of the memory beyond the capabilities of the processor will not increase performance. It changes the bottleneck from the RAM to the processor. See also #3.
2. Speed of Cache inside the processor
Cache memory resides inside the shell of the processor. This is one of the fastest types of memory available. Processors will search this memory before searching RAM. Improving the speed and quantity of this memory will improve the performance of your processor, unless other cores are also accessing this memory. For multiple cores accessing memory, there needs to be conflict resolution, which may slow down your applications performance.
Note: There is nothing you can do to speed up or change the size of the cache memory except get another processor. The cache is not something that can be easily changed by human or robotic hands.
3. Number of entities sharing the memory bus
The memory bus is like a highway that entities use to get to the RAM. As with a highway, more lanes means faster throughput (e.g. 16-bit width vs. 32-bit). Many buses also have a speed limit, again the higher the limit, the faster the access. Probably the most notable concept is the number of entities connected to the bus. As with highways, more users slows down the traffic. In most memory buses, only one entity can use it at a time; other entities must wait. Reducing the number of entities that need to use the memory bus will speed up your program.
Some common entities sharing the memory bus: CPU, DMA controllers, Video processors, sound processors and network or I/O processors.
4. Virtual Memory.
Many modern computers employ virtual memory. If the program requires more memory than is available in RAM, the operating system will swap sections of memory with areas on the hard drive. This costs more performance time than reducing memory operating speed. A memory intensive program is more efficient by only using memory allocated to it than all the memory it could need. Reducing these virtual memory swaps will speed up a program.
In summary, there is a maximum speed at which your application can execute. Memory, both internal cache and external RAM, are contributing factors to the upper limit. There are bigger factors that prevent applications from reaching this limit. Some of these factors are I/O operations, and other concurrent tasks. The design and implementation of a program can also contribute to the slowness. More performance can be gained by eliminating I/O operations, concurrent tasks and redesigning the software than by changing the upper limit of memory access speed. Changing these limits will increase your program's performance, but not as drastic as the other techniques.