Learn

Memory and Storage

Start with RAM and storage. Then learn how locality and virtual memory affect a running program, and how allocation mistakes can waste resources.

A program’s working information

Begin with RAM and storage to distinguish temporary working memory from persistent data. Then explore cache locality to see why nearby or recently used data can be cheaper to access, and virtual memory to understand how an operating system maps a program’s addresses to physical memory.

The stack and heap article explains two common allocation regions, while memory leaks shows how retained objects can grow a program’s footprint. Together, these topics help explain why resource use depends on data layout, lifetime, and access pattern—not only the amount of information a program starts with.

Follow data through a running program

Memory is not one uniform place with one uniform cost. A program may hold active values in RAM, retrieve frequently used data through caches, and read persistent records from storage. The route a value takes—and how often the program needs it—can influence latency and total work. That is why two algorithms with similar operation counts can behave differently when one touches data in a more favorable pattern.

Memory lifetime matters too. Temporary values can be released when work ends; retained values may be needed later but consume capacity. A leak occurs when software continues to hold objects it no longer needs. Virtual memory gives processes an address space managed by the operating system, but it does not make physical memory unlimited.

Use this section to connect data representation with system cost. Start with RAM and storage, continue through cache locality and virtual memory, then examine allocation through stack and heap and memory leaks. These are general computing concepts, not claims about a specific LuMATH implementation.

Explore this topic