# What is the overhead of Virtual Memory?

What is the price paid for the vast virtual address space provided to programmers for their applications? Or in other words, what is the overhead due to virtual memory?

Is there any other overhead from implementing virtual memory, beyond memory consumed by the kernel?

• What do you mean by "OS Kernel is the overhead in Virtual Memory implementation". – babou Dec 12 '14 at 22:55
• I was looking at this picture here eduunix.ccut.edu.cn/index2/html/linux/… Quoting from the article: As you can see in Figure 2-6, the kernel occupies a quarter of the virtual address space starting from address 0xC0000000. This region is also known as "kernel space." The rest of the address space is occupied by application-specific text, data, and library mappings. This is also known as "user space." – user141865 Dec 13 '14 at 0:36
• The kernel requires whatever space it requires. I am not sure I undrstand the intent of this dioagram without the context of the book (Kernel space seems really large). You may consider that overhead, but it is not due to virtual memory. When you ask "What are the overhead of Virtual Memory implementation?", you are asking for the extra cost due to the fact that virtual memory is being used, not what application or other code is using that virual memory. – babou Dec 13 '14 at 0:59
• babou, I guess you're right. I should double check with my professor. So, if I understand your answer in the post below correctly, you're saying that the major extra cost of implementing VM is loading some part of the recently used virtual address in the physical memory? This question has 5 points, so my guess is my professor were looking for 5 different key points in the answer. – user141865 Dec 13 '14 at 1:14
• Well. I cannot know what your professor wanted. I did not follow that class. The cost of pages faults and the risk of thrashing is the first thing that comes to mind. It is an overhead in execution time, which you pay for saving on the cost of fast memory. That is a very classical trade-off. May-be your teacher wants you to discuss the issue. Try to search the web and read some documents or books. Your teacher may expect references to the documents you read (good practice anyway), so you have to show you did. Virtual memory is a form of caching, so there may be info regarding caching generally – babou Dec 13 '14 at 1:22