Memory Flashcards

1
Q

How does one find the actual amount of used memory when using the top utility?

A

Actual Memory Used = Used - Cached

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In terms of memory, what is a common occurrence on a system that has been running awhile.

A

A large portion of the RAM will be taken up by the cache.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why does memory pressure occur?

A

Memory pressure occurs when memory is needed on a system. Processes may be killed, memory may be swapped out, data may be removed from the cache, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you tell you are under memory pressure?

A

Look for the entries in /proc/vmstat. Virtually all the entries that say “scan” in them are reacting to memory pressure. These counters also have per-zone counterparts in /proc/zoneinfo.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the different layers of memory? What is the order from fastest to slowest?

A

CPU register, CPU cache, RAM, disk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How large is a page?

A

4KB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is paging?

A

Paging is the movement of pages in and out of memory. Allows partially loaded programs to execute, making it possible for programs larger than the main memory to run.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Difference between a dirty page and a clean page.

A

A dirty page requires a write to the disk before unloading the file from memory.
Ex: Opening a file, adding a word and then saving the file

A clean page means no changes were made to a file, so it can be unloaded from memory immediately.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is file system paging?

A

Reading/writing of pages in memory mapped files and of filesystems that use the page cache.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is anonymous paging?

A

Paging that is private to a process. Anonymous paging = swapping (moving pages in and out of swap). Page ins can hurt performance as they are run synchronously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

On demand paging

A

On demand paging maps pages of virtual memory to main memory when it is needed as opposed to when memory is first allocated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a page fault and when does it occur?

A

A page fault occurs the first time a page of virutal memory is mapped. The page takes longer to access the first time than it will thereafter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What makes up the Virtual memory size?

Resident Set Size(RES)?

A

Virt Size = Size of all allocated pages(unmapped, mapped to main memory, mapped to swap)

RES = size of allocated main memory pages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What do the file system cache and buffer cache improve?

A

The file system cache improves read performance, while buffering inside the cache improves write performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly