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

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

段页结合优点和缺点
优点
(1) 它提供了大量的虚拟存储空间。
(2) 能有效地利用主存,为组织多道程序运行提供了方便。
缺点:
(1) 增加了硬件成本、系统的复杂性和管理上的开消。
(2) 存在着系统发生抖动的危险。
(3) 存在着内碎片。
(4) 还有各种表格要占用主存空间。
边栏推荐
- [beauty of software engineering - column notes] 25 | what methods can improve development efficiency?
- Unity多人联机框架Mirro学习记录(一)
- Ue4/ue5 C disk enlargement processing
- Exercise: store department information
- sql判断语句的编写
- [robomaster] a board receives jy-me01 angle sensor data -- Modbus Protocol & CRC software verification
- 【NOI模拟赛】计算几何(凸包,暴力,并查集)
- Unicode私人使用区域(Private Use Areas)
- Low power Bluetooth 5.0 chip nrf52832-qfaa
- 阿里巴巴政委体系-第四章、政委建在连队上
猜你喜欢
![[cryoEM] Introduction to FSC, Fourier shell correlation](/img/01/6a4f6041444abfd1d3ca7e0c14b524.png)
[cryoEM] Introduction to FSC, Fourier shell correlation
![[robomaster] control RM motor from scratch (2) -can communication principle and electric regulation communication protocol](/img/7c/ba52c7bc11d165892d7390ad8ce298.png)
[robomaster] control RM motor from scratch (2) -can communication principle and electric regulation communication protocol
![[paper reading] tomoalign: a novel approach to correcting sample motion and 3D CTF in cryoet](/img/3a/75c211f21758ca2d9bb1a40d739d80.png)
[paper reading] tomoalign: a novel approach to correcting sample motion and 3D CTF in cryoet

Simplefoc parameter adjustment 2- speed and position control

Useful websites

SQL 面试碰到的一个问题
![[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 MDK (keil5) contents mismatch error summary

TCP——滑动窗口

Solving linear programming problems based on MATLAB
随机推荐
torch.nn.functional.one_hot()
[beauty of software engineering - column notes] 29 | automated testing: how to kill bugs in the cradle?
Some thoughts on growing into an architect
Lora opens a new era of Internet of things -asr6500s, asr6501/6502, asr6505, asr6601
Unicode私人使用区域(Private Use Areas)
Use the cloud code to crack the problem of authentication code encountered during login
Research on autojs wechat: the final product of wechat automatic information sending robot (effective demonstration)
Useful websites
An optimal buffer management scheme with dynamic thresholds paper summary
[paper reading | cryoet] gum net: fast and accurate 3D subtomo image alignment and average unsupervised geometric matching
Dynamic thresholds buffer management in a shared buffer packet switch paper summary
Unity beginner 2 - tile making and world interaction (2D)
Huawei wireless device configuration uses WDS technology to deploy WLAN services
Explanation and closing method of server 135, 137, 138, 139, 445 and other ports
[robomaster] control RM motor from scratch (2) -can communication principle and electric regulation communication protocol
BiSeNet v2
UE4 principle and difference between skylight and reflecting sphere
Dp1332e multi protocol highly integrated contactless read-write chip
In the MySQL connector of flynk CDC, the MySQL field is varbinary, which is officially
[cryoelectron microscope | paper reading] interpretation of sub fault average m software: multi particle cryo EM refining with M