Virtual Memory

后端 未结 5 2048
不思量自难忘°
不思量自难忘° 2020-12-18 06:31

Most of the literature on Virtual Memory point out that the as a Application developer,understanding Virtual Memory can help me in harnessing its powerful capabilities. I ha

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-18 06:48

    Well, the concept is pretty simple actually. I won't repeat it here, but you should pick up any book on OS design and it will be explained there. I recommend the "Operating System Concepts" from Silberscahtz and Galvin - it's what I had to use in the University and it's good.

    A couple of things that I can think of what Virtual Memory knowledge might give you are:

    • Learning to allocate memory on page boundaries to avoid waste (applies only to virtual memory, not the usual heap/stack memory);
    • Lock some pages in RAM so they don't get swapped to HDD;
    • Guardian pages;
    • Reserving some address range and committing actual memory later;
    • Perhaps using the NX (non-executable) bit to increase security, but im not sure on this one.
    • PAE for accessing >4GB on a 32-bit system.

    Still, all of these things would have uses only in quite specific scenarios. Indeed, 99% of applications need not concern themselves about this.

    Added: That said, it's definately good to know all these things, so that you can identify such scenarios when they arise. Just beware - with power comes responsibility.

提交回复
热议问题