Demand Paging
-> According to the concept of Virtual Memory, in order to execute some process, only a part of the process needs to be present in the main memory which means that only a few pages will only be present in the main memory at any time.
-> However, deciding, which pages need to be kept in the main memory and which need to be kept in the secondary memory, is going to be difficult because we cannot say in advance that a process will require a particular page at particular time.
-> Therefore, to overcome this problem, there is a concept called Demand Paging is introduced. It suggests keeping all pages of the frames in the secondary memory until they are required. In other words, it says that do not load any page in the main memory until it is required.
-> Whenever any page is referred for the first time in the main memory, then that page will be found in the secondary memory.
-> After that, it may or may not be present in the main memory depending upon the page replacement algorithm which will be covered later in this tutorial.