VMWare Inc Interview Question
Quality Assurance EngineersTeam: QATeam
Country: United States
Interview Type: In-Person
Paging memory or space means the amount of space to be allocated on the HDD which is used to swap out from main memory. This is usually done to make better use/distribution of available limited main memory amongst multiple processes. So that every process which usually can address 2GB (32-bit) or if PAE then 3GB of user space virtually can access that space, though all of it if allcoated may not be present in main memory but partly in the persistent store i.e. HDD.
Paging:
The memory requirements of the process is divided into units called pages. Only those pages are kept in the memory that are currently under execution and remaining can be on the secondary store. Also, paging is important in implementation of virtual memory where every process is given the perception that it has way larger memory for itself that that is actually present on the system.
Swapping:
In a multi-tasking environment, when the processor moves from one process to the next, it stores the current state of the current process to the secondary store and loads the state of the next process to be executed in the main memory. This is called swapping.
Swaping and paging are both used to free some memory location in main memory.
Swaping: it mainly occurs when there is heavy demand on the system memory. It uses swap files, swap files work by swaping the entire process into the swap file.
Paging: in paging virtual memory is freed by moving the pages of a program into the paging file, Not all the pages of the program are moved out, only those which the operating system thinks are not being used frequently or are left idle are moved out. The memory used by the paged out portions is not immediately freed. It is kept on stand by in case the paged out portions are re-activated (which are still stored in system menory)they reclaim it. But if some other application requires that memory it is given up to them.
Paging: If a certain memory location is not present in RAM then a page fault takes place. This causes the page which contains this memory location to be brought into ram. (Sometimes prefetching can also bring pages into RAM). This way of dealing with memory in terms of pages is called paging.
- Kumar August 07, 2013Swapping: When the main memory is full and now if there is a page fault, then replacement will take place. The page to be evicted is placed in a backing store (usually dedicated memory on disk). This is swapping. If later this page is needed, it will be reloaded from backing store