Virtualizing Memory

In this lesson, you will study the concept of virtualizing memory.

Now, let’s consider memory. The model of physical memory presented by modern machines is very simple. Memory is just an array of bytes; to read memory, one must specify an address to be able to access the data stored there; to write (or update) memory, one must also specify the data to be written to the given address.

Memory is accessed all the time when a program is running. A program keeps all of its data structures in memory and accesses them through various instructions, like loads and stores or other explicit instructions that access memory in doing their work. Don’t forget that each instruction of the program is in memory too; thus memory is accessed on each instruction fetch.

Running mem.c

Let’s take a look at a program that allocates some memory by calling malloc():

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy