Google News
logo
Embedded C - Interview Questions
What Is a Virtual Memory in Embedded C and how can it be implemented?
Virtual memory is a means of allocating memory to the processes if there is a shortage of physical memory by using an automatic allocation of storage. The main advantage of using virtual memory is that it is possible to have larger virtual memory than physical memory. It can be implemented by using the technique of paging.
 
Paging works as follows :
 
* Whenever a process needs to be executed, it would be swapped into the memory by using a lazy swapper called a pager.
 
* This decreases the time taken to swap and unnecessary reading of memory pages and reduces the physical memory required.

* The pager tries to guess which page needs to get access to the memory based on a predefined algorithm and swaps that process. This ensures that the whole process is not swapped into the memory, but only the necessary parts of the process are swapped utilizing pages.
Advertisement