虚拟内存是否存在于我们计算机系统中的某个地方(即硬盘上)?
如果不是,如果数据不在主内存中,即(发生页面错误),如何进行从虚拟内存到硬盘中真实数据的映射。是否有任何表维护从虚拟内存到硬盘数据的映射..
虚拟内存是否存在于我们计算机系统中的某个地方(即硬盘上)?
如果不是,如果数据不在主内存中,即(发生页面错误),如何进行从虚拟内存到硬盘中真实数据的映射。是否有任何表维护从虚拟内存到硬盘数据的映射..
希望这有帮助。
Yes virtual memory really does exist and yes there is a table that maintains the mapping. Look for page table in wikipedia for instance. In fact most of the virtual memory article will answer your question in full.
Most of your questions are answered by http://en.wikipedia.org/wiki/Virtual_memory.
Short answer, no :) Virtual Memory is virtual! Especially if you consider virtual memory as "the memory that can be addressed by a process". On 64 bit systems, the whole disk hardly could back the entire virtual memory. So "in reality", as you asked, I would say no.
Long(-ish) answer: virtual memory exists as a series of data structures in the kernel. They mostly keep trace of which page/segment is currently reserved, allocated, mapped to a file or mapped to physical memory. Also, the answer is different if what you look at is "allocated virtual memory". This always exists in one form or another (usually, pages backed by hard-disk swap space).
Yes, most used bytes of virtual memory exist somewhere. I say "most" because pages that map registers of some special hardware can have holes. But all memory allocated by you app exists either in RAM or on hard disk.
The wikipedia article explains all the details: http://en.wikipedia.org/wiki/Virtual_memory