Does a program use logical address in a continuous manner?

心已入冬 提交于 2019-12-25 07:47:38

问题


Does a program always use logical address in a continuous manner? Is it possible that a program does not use 0-200 logical addresses and instead use random addresses?

I am asking this because while I was reading about memory management in Operating system concepts by Galvin, the author mentioned that the page table stores an entry for each page no matter whether the page is valid or invalid.

If the pages were used continuously then we would not need to store all entries.


回答1:


The validate address range in a logical address space is invariably discontinuous.

To start with, there is a separate range of addresses for the user space and the system space. The system space is usually at a high range of addresses while the user space usually starts at a low range of addresses.

Even the user space tends to be discontinuous. Application data tends to start at the low end and stack space (which grows downward) tends to be at higher addresses.

the author mentioned that the page table stores an entry for each page no matter whether the page is valid or invalid.

That's not right at all.

In systems with linear page tables, there is a maximum size of the page table that usually can be set by system parameters and reduced by process quotas. There are likely to be logical addresses with no page table entry at all.

In systems with multilevel page tables, there can be gaps in the logical address space caused by missing page tables.



来源:https://stackoverflow.com/questions/40365071/does-a-program-use-logical-address-in-a-continuous-manner

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!