Categories
Development Linux

How is memory reported in linux? (How is calculated?)

I’m trying to understand how memory is reported in linux. Assume that there exist only three processes in a system:

Process 1 uses

  • 100 MB exclusive memory (in RAM)
  • 200 MB exclusive memory (on Disc – either swapped or not loaded)
  • 300 MB shared with Process 2 (in RAM)

Process 2 uses

  • 10 MB exclusive memory (in RAM)
  • 300 MB shared with Process 1 (in RAM)
  • 30 MB shared with Process 3 (on Disc – either swapped or not loaded)

Process 3 uses

  • 18 MB exclusive memory (in RAM)
  • 30 MB shared with Process 2 (on Disc – either swapped or not loaded)

Now, what would be the report of a program like “top” or “Gnome System Monitor” for the following quantities?

  • Resident Memory of each process
  • Shared Memory of each process
  • Virtual Memory of each process
  • Total Memory Usage (also reported as percentage of physical memory, i.e. RAM)

Leave a Reply

Your email address will not be published. Required fields are marked *