What does pagination mean in a specific sense?

The way I understand the concept of "process" is that it is an executable instance of an executable program. exe is in secondary memory, and the executable instance is in RAM. If this understanding is correct, I would like to know what is actually meant by this abstract description: "Separation of the process into" pages "and the launch of some pages in RAM and saving the rest in secondary memory for replacement if necessary"? The question here is in the context of virtual memory.

Adding a "programming" context to the question, following the suggestions of the moderators:

Let's say I am writing a small program to list numbers from 1 to 100 (or), to print "Hello world" (or) some desktop utility for scanning a text file and printing words in a file one at a time on the desktop window. Given the final executable that I have, as soon as these programs are compiled and linked, how can I “split” the executable and run the parts in RAM when the executable is launched? How can I understand and imagine the idea of ​​what “should be” in RAM at a certain point in time and what “should not”?

+4
source share
1 answer

You have this (division) right there, in the translation of the virtual to the physical address. The virtual address space is divided into blocks of one or several kilobytes (usually the same size), each of which can be associated with a piece (page) of physical memory of the same size.

Those parts of the executable file (or process) that have not been used or have not been used recently, do not need to be copied to physical memory from disk, and therefore the corresponding parts of the virtual address space may not also be associated with physical memory. When a system becomes low on free physical memory, it can redistribute some pages by storing their contents on disk if necessary (or not, if they contain read-only data / code).

0
source

All Articles