Priority aging is gradually increasing the priority of tasks which have not yet had much CPU time---or decreasing the priority of the currently-running task (amounts to the same thing).It allows even very low-priority processes a chance to be scheduled once in a while. Stops them from starving.
Additional information: each executable file must contain a table of addresses to be relocated.
Potential disadvantages: Code may not be easily moved later (without reference to the relocation table). (Additional points for saying: text segment could not be directly mapped from the executable file, using the paging hardware.)
- Compaction: shuffle around allocated blocks in memory to move the 'holes' together, and create enough space to use.
- Swapping: (in a system which partitions memory among different processes) Swap some processes out to disk to create enough space. Swap them back in at different (less fragmentary) positions later on.
- Processes may be malicious. They may be attempting to illicitly obtain secret information from other users on the system. They may be viral code wishing to infect other software on the system.
- Code may be buggy.
(Mentioned in the lectures that it is impossible for the OS to predict in advance which areas of memory a particular piece of code will visit, in general.)
Maximum utilisation of memory. The area between the stack and the heap can be used by whichever grows fastest. (In this case, the stack would grow downwards, the stack grow upwards.)
Overlays. Swapping swaps entire process at a time. Overlays only swap in and out sections of program text.But! They are not quite the same: overlays only apply to executable code (the text segment); swapping a process out of memory removes the text, stack and data segments.
Pages from text segments need not be written to disk when they are evicted from memory, because they can be read back in from the executable file.
211 = 2K : offset into page is 11 bits.
Effective size of address space is
232 - 2G
= 4G - 2G
= 2G = 231Number of pages is
2G ÷ 2K
= 231 ÷ 211 = 220220 = 1M pages (1048576 pages).
The kernel has got to be able to access all processes' memory. It must also be able to access memory which is private to the OS, and not mapped to any process's virtual memory (for example, the page tables themselves).To simulate physical access mode, the OS might set up a page table for itself, which maps page 0 to frame 0, page 1 to frame 1, etc.