| English | 意味 |
|---|---|
| pages/ˈpeɪdʒɪz/ | ページ |
| paging/ˈpeɪdʒɪŋ/ | ページング |
| segmentation/ˌseɡmənˈteɪʃn/ | セグメンテーション |
| virtual address space/ˈvɜːtʃuːəl əˈdres speɪs/ | 仮想アドレス空間 |
| frames/freɪmz/ | フレーム |
| page table/peɪdʒ ˈteɪbl/ | ページテーブル |
| page fault/peɪdʒ fɒlt/ | ページフォルト |
| swap file/swɒp faɪl/ | スワップファイル |
| thrashing/ˈθræʃɪŋ/ | スラッシング |
The disk light that means the machine has given up
- Open too many applications on a machine short of memory and something distinctive happens. Everything slows almost to a stop, and the disk light stops flickering and stays on.
- The processor is not busy. It is waiting, because the memory each program needs is on the disk, and fetching one page evicts another that is needed a moment later.
- The machine is doing nothing but moving pages. It has enough work and enough memory to do neither.
- This lesson is virtual memory, how paging 分页 and segmentation 分段 provide it, and how the same mechanism that makes memory look bigger can make a machine useless.
The virtual address space
- Each process gets its own virtual address space 虚拟地址空间: a clean, contiguous range of addresses starting at zero, which the OS maps to wherever the data really is.
- Three things follow. Each process sees a simple private space and need not know what else is running. Processes are protected from each other, since one cannot name an address in another's space. And the total memory in use can exceed the physical RAM, because part of it lives on disk.
- That isolation is a security boundary as much as a convenience.
仮想メモリの利点は、それが:
難易度 1/5 · 100 コイン + 今日初回完了時に小ボーナス付与
仮想メモリは各プロセスにプライベート空間を提供し、ディスクを使用して動作セットが導入されたRAMを超えることを可能にします。
各プロセスに仮想アドレス空間を与えることで達成されることは何ですか?すべて該当するものを選択してください。
難易度 2/5 · 140 コイン + 今日初回完了時に小ボーナス付与
仮想メモリは単純さ、隔離、容量を提供しますが、 speed costがかかります。なぜなら、メモリーの一部分が実際にはディスク上にあるからです。
Paging
- The virtual space is divided into fixed-size pages 页; physical memory into frames 页框 of the same size. A page table 页表 records which frame currently holds each page.
- When a process uses an address, the hardware looks up the page in the table and finds the frame. If the page is not in RAM, that is a page fault 缺页.
- On a page fault the OS reads the page from the swap file 交换文件 on disk into a free frame. If no frame is free, it must first evict a page, writing it back to disk if it has been changed.

Same-sized pages and frames, joined by a table
ページングでは、メモリは以下のように分割されます:
難易度 1/5 · 100 コイン + 今日初回完了時に小ボーナス付与
ページングは固定サイズのページとフレームを使用し、ページテーブルによってリンクされます。(可変サイズはセグメンテーションです。)
ページフォールトが発生するのは:
難易度 1/5 · 100 コイン + 今日初回完了時に小ボーナス付与
アクセスされたページがフレームに含まれないため、OSは必要に応じて他のページを除外してスワップファイルから取得します。
Worked example: what happens on a page fault
- A process accesses an address whose page is not in RAM. Describe what the OS does. [4]
- The hardware detects that the page is not present and raises a page fault interrupt, and the process is blocked.
- The OS finds a free frame; if there is none, it selects a page to replace, and writes it back to the swap file if it has been modified.
- It reads the required page from the swap file into that frame and updates the page table.
- The process is returned to the ready state and the instruction is retried. Four steps, four marks, and note the process was blocked throughout.
ページフォールトが発生した際发生了什么か
ページフォールトをトレースしてください。プログラムがRAMに存在しないページにアクセスすると、OSは静かにディスクから取得してページテーブルを更新します——これにより、プログラムは物理的に存在する以上のメモリを認識できます。
ページフォールトに対するOSの対応手順を正しい順に並べ替えてください。
難易度 3/5 · 200 コイン + 今日初回完了時に小ボーナス付与
検知とブロック、スペース確保、読み込み、記録、再実行。ページフォールトは正常なメカニズムであり、エラーではありません。
Thrashing
- Choosing which page to replace matters, because the wrong choice means it will be needed again immediately.
- When there is too little RAM for the working set of the running processes, almost every access causes a page fault, and every fault evicts a page that is wanted again at once.
- The system then spends nearly all its time swapping pages instead of executing instructions. That is thrashing 抖动, or disk thrashing, and it is the state described at the top of this lesson.
- The cure is more RAM, or fewer processes; a faster processor does not help at all, because the processor is not the thing that is busy.
機械がほぼ停止状態になり、ディスクが常時動作しています。これを解決する方法は何ですか?
難易度 1/5 · 100 コイン + 今日初回完了時に小ボーナス付与
これはスラッシングです:ほとんどのアクセスでフォールトが発生し、プロセッサが待機しています。プロセッサが最も忙しくなっているわけではないため、速度を上げても変化はありません。
Segmentation
- Segmentation divides memory into variable-sized logical segments that match the program's own structure: the code, the stack, the heap, a large data array.
- Because a segment is a logical unit, it can carry its own permissions: the code segment can be read-only and executable, the stack read-write and not executable.
- The contrast the exam wants: pages are fixed-size and have no meaning to the program; segments are variable-sized and correspond to logical parts of it. Many real systems combine the two, paging within segments.

Segments are the program's own parts, not equal slices
各メモリ管理用語とその意味を一致させてください。
難易度 2/5 · 140 コイン + 今日初回完了時に小ボーナス付与
ページング=固定ページ;セグメンテーション=論理的可変単位;ページフォールトはスワップを引き起こし、フォールトが多すぎるとスラッシングになる。
セグメンテーションはメモリを可変サイズの論理単位(コード、スタック、ヒープ)に分割し、それぞれ固有の権限を持ちます。一方、ページングは固定サイズのページを使用します。
難易度 1/5 · 100 コイン + 今日初回完了時に小ボーナス付与
セグメントはプログラムの論理構造に対応しますが、ページは均一な固定サイズのブロックです。一部のシステムでは両者を組み合わせています。
ページのようにすべて同じサイズではなく、セグメントは ____ サイズでプログラムの論理部分に対応します。
難易度 1/5 · 100 コイン + 今日初回完了時に小ボーナス付与
セグメントはコード、スタック、またはヒープであるため、固有の権限を持てます。ページはプログラムにとって意味のない物理的な区切りです。
Worked example: paging against segmentation
- State two differences between paging and segmentation. [2]
- Pages are all of a fixed size, decided by the system; segments are of variable size, decided by the logical parts of the program.
- A page is a purely physical division with no meaning to the program; a segment corresponds to a logical unit such as the code or the stack, and can be given its own access permissions.
- A third if needed: paging can leave unused space inside the last page of an allocation, while segmentation leaves gaps of unusable space between segments.
Marks that slip away
- Virtual memory does not create memory. It lets the total in use exceed physical RAM by keeping part of it on disk, at the cost of disk accesses.
- A page fault is not an error. It is the normal mechanism by which a page is brought in.
- Thrashing is spending more time swapping than executing, and the fix is more RAM or fewer processes, never a faster processor.
- Fixed size versus variable size, logically meaningful is the difference between paging and segmentation. Say both halves.
You've got it
- a virtual address space gives each process a private contiguous range, protects processes from each other, and lets memory in use exceed physical RAM
- paging: fixed-size pages mapped to frames by a page table; a page fault blocks the process while the OS evicts a page if necessary, loads from the swap file, updates the table and retries
- thrashing is more time spent swapping than executing; cure it with more RAM or fewer processes
- segmentation uses variable-sized segments matching the program's logical parts, each with its own permissions; many systems page within segments