当前位置:网站首页>分段分页以及段页结合
分段分页以及段页结合
2022-07-29 08:08:00 【Meme_xp】
分页、分段的技术出现之前
在分段这个技术还没有出现之前,程序运行是需要从内存中分配出足够多的连续的内存,然后把整个程序装载进去
某个程序大小是10M,然后,就需要有连续的10M内存空间才能把这个程序装载到内存里面。如果无法找到连续的10M内存,就无法把这个程序装载进内存里面,程序也就无法得到运行
产生问题
①地址空间不隔离
②程序运行时候的地址不确定
③内存使用率低下
分段技术的出现与虚拟地址空间
分段:就是将一个程序分成代码段,数据段,堆栈段什么的,每个段各自管理不同的数据

虚拟地址空间
简单的说就是可以寻址的一片空间。如果这个空间是虚拟的,我们就叫做虚拟地址空间;如果这个空间是真实存在的,我们就叫做物理地址空间。虚拟地址空间是可以任意的大的,因为是虚拟的。而物理地址空间是真实存在的,所以是有限的
分段技术把虚拟地址空间映射到了物理地址空间,并且你写的程序操作的是虚拟地址
分段技术解决了体现出了隔离性,使得程序无需关注物理地址是多少,只要虚拟地址没有改变,那么,程序就不会操作地址不当两个问题
分页技术的出现解决了效率使用低下的问题
分页技术的大概原理
分页的基本方法是将地址空间等分成某一个固定大小的页;每一页大小由硬件来决定,或者是由操作系统来决定(如果硬件支持多种大小的页)。
页面大小的选择
页面大小是固定的,由你的机器和硬件所决定,不同的机器可能页面大小不同
页面大小一般是2的幂,通常是512B~8KB
页面尺寸小:内存碎片小,内存利用率高,但页面数目多,使页表过长,占大量内存,管理开销大
页面尺寸大:页表端,内存利用率低且内存碎片化大,管理开销小
分页、分段的区别

段页结合优点和缺点
优点
(1) 它提供了大量的虚拟存储空间。
(2) 能有效地利用主存,为组织多道程序运行提供了方便。
缺点:
(1) 增加了硬件成本、系统的复杂性和管理上的开消。
(2) 存在着系统发生抖动的危险。
(3) 存在着内碎片。
(4) 还有各种表格要占用主存空间。
边栏推荐
- [paper reading | cryoet] gum net: fast and accurate 3D subtomo image alignment and average unsupervised geometric matching
- Huawei wireless device configuration uses WDS technology to deploy WLAN services
- Alibaba political commissar system - Chapter III, Alibaba political commissar and cultural docking
- 20 hacker artifacts
- [noi simulation] computational geometry (convex hull, violence, and search set)
- Implementation of simple matcap+fresnel shader in unity
- Low power Bluetooth 5.0 chip nrf52832-qfaa
- Processes and threads
- Volatile keyword parsing of C #
- Mqtt server setup and mqtt.fx testing
猜你喜欢

Official tutorial redshift 01 basic theoretical knowledge and basic characteristics learning
![[密码学实验] 0x00 安装NTL库](/img/2a/03d95082a2a63238b475b3f7f3e13d.png)
[密码学实验] 0x00 安装NTL库

Security baseline of network security
![[beauty of software engineering - column notes] 30 | make good use of source code management tools to make your collaboration more efficient](/img/d1/5b980d8b9580b9808b2b3f51d5b9c6.png)
[beauty of software engineering - column notes] 30 | make good use of source code management tools to make your collaboration more efficient

Tcp/ip five layer reference model and corresponding typical devices and IPv6

Simplefoc parameter adjustment 2- speed and position control

【学术相关】为什么很多国内学者的AI的论文复现不了?

Matrix decomposition and gradient descent

Research on autojs wechat: the final product of wechat automatic information sending robot (effective demonstration)
![[beauty of software engineering - column notes] 21 | architecture design: can ordinary programmers also implement complex systems?](/img/db/ef33a111bcb543f9704706049bccc2.png)
[beauty of software engineering - column notes] 21 | architecture design: can ordinary programmers also implement complex systems?
随机推荐
STM32 detection signal frequency
STM32 printf problem summary semihosting microlib understanding
10 common software architecture modes
Unicode private use areas
Implementation of simple cubecap+fresnel shader in unity
Unity multiplayer online framework mirror learning record (I)
[cryoelectron microscope | paper reading] interpretation of sub fault average m software: multi particle cryo EM refining with M
[paper reading | cryoelectron microscope] interpretation of the new subtomogram averaging method in relion 4.0
Unicode私人使用区域(Private Use Areas)
Solve the problem that the disk is full due to large files
Alibaba political commissar system - Chapter 4: political commissars are built on companies
华为无线设备配置利用WDS技术部署WLAN业务
STM32 serial port garbled
125kHz wake-up function 2.4GHz single transmitter chip-si24r2h
Phy6252 is an ultra-low power Bluetooth wireless communication chip for the Internet of things
(Video + graphic) machine learning introduction series - Chapter 5 machine learning practice
Mqtt server setup and mqtt.fx testing
[beauty of software engineering - column notes] "one question and one answer" issue 3 | 18 common software development problem-solving strategies
C language interview preparation I (about understanding Department)
网络安全之安全基线