- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
HYPERLINK /gustavo/blog/post/anatomy-of-a-program-in-memory Anatomy of a Program in Memory
Memory management is the heart of operating systems; it is crucial for both programming and system administration. In the next few posts I’ll cover memory with an eye towards practical aspects, but without shying away from internals. While the concepts are generic, examples are mostly from Linux and Windows on 32-bit x86. This first post describes how programs are laid out in memory.
Each process in a multi-tasking OS runs in its own memory sandbox. This sandbox is the?virtual address space, which in 32-bit mode is?always a 4GB block of memory addresses. These virtual addresses are mapped to physical memory by?page tables, which are maintained by the operating system kernel and consulted by the processor. Each process has its own set of page tables, but there is a catch. Once virtual addresses are enabled, they apply to?all software?running in the machine,?including the kernel itself. Thus a portion of the virtual address space must be reserved to the kernel:
This does?not?mean the kernel uses that much physical memory, only that it has that portion of address space available to map whatever physical memory it wishes. Kernel space is flagged in the page tables as exclusive to? HYPERLINK /gustavo/blog/post/cpu-rings-privilege-and-protection privileged code?(ring 2 or lower), hence a page fault is triggered if user-mode programs try to touch it. In Linux, kernel space is constantly present and maps the same physical memory in all processes. Kernel code and data are always addressable, ready to handle interrupts or system calls at any time. By contrast, the mapping for the user-mode portion of the address space changes whenever a process switch happens:
Blue regions represent virtual addresses that are mapped to physical memory, whereas white regions are unmapped. In the example above, Firefox has used far more of its virtual address space due to its legendary memory hung
您可能关注的文档
- Word stress-英语语音练习.doc
- World countries_最全世界各国家资料英文合集.docx
- WTO管理英语整理版.doc
- ZC-FSHB5反渗透海水淡化装置 中英文技术规格书.doc
- ZTE English 900 中兴英语900句.doc
- Н. М. Раевская -- Modern English Grammar.doc
- 艾莱克斯”少儿英语培训学校创业计划书.doc
- 爱丽丝梦游仙境__Alice adventures in wonder land.doc
- 安徽省蚌埠二中11—12学年高三上学期期中考试(英语试题及答案).doc
- 安徽省名校2012届高三第五次联考试卷(英语)附答案.doc
最近下载
- QSY 01039.1-2019 油气集输管道和厂站完整性管理规范第1部分:总则.pdf VIP
- 劳动合同_劳动合同电子版下载8篇.docx VIP
- 高磁感取向硅钢高效脱碳退火工艺.pdf VIP
- 2024年考研英语二真题及解析.pdf VIP
- 四年级语文上册习作:我的家人课件.pptx VIP
- SH_T 3046-2024《石油化工立式圆筒形钢制焊接储罐设计规范》.pdf VIP
- 水运工程测量定额JTS-T 273-2024.docx
- 2025年贵阳职业技术学院单招职业技能考试题库带答案.docx VIP
- 附件1:公路桥梁护栏施工作业台车计算书.docx
- 2023年考研英语二真题及答案.pdf VIP
文档评论(0)