Physical vs Virtual Memory

  • Physical: Exists on chips or drives
    • RAM
    • SSD
    • HD

Physical vs Virtual Memory Continued

  • Virtual: maps memory addresses used by a program, called virtual addresses, into physical addresses in computer memory.
  • Processes have to share the CPU and RAM with othe processes:
    • how do we make sure no one runs out of memory (thus ending the process)?
    • make sure memory doesn't get corrupted?
    • make sure other processes don't write to my memory?

Virtual Memory

-Good overview

Benefits:

  • keeps only active stuff in memory, can put remainder on disk
  • each process has a uniform address space
  • address space of one process cannot interfere with another

A Systems view of Physical Memory

Swap

Similar to paging in windows. If our physical memory is exhausted, we can write the contents of RAM to disk. Bring it back when necessary.

More memory related commands

  • free
  • swapon -s
  • vmstat
  • top
  • ps