当前位置:网站首页>Memory layout of program
Memory layout of program
2022-07-25 13:00:00 【51CTO】
Memory is divided into kernel space and user space . The user memory space is divided into the following areas from low to high :
Reserves :
A protected and inaccessible area of memory , In most operating systems, tiny addresses are usually not allowed to be accessed , therefore C The language assigns an invalid pointer to 0.
Code segment :
Store executable code ( Binary format ), And constant values ( Like string constants ), Can be shared by multiple programs , read-only .
Initialization data segment (.data):
Store initialized global and static variables . This type of data , Will allocate memory space before the program runs .
Uninitialized data segment (.bss):
Store uninitialized global variables and static variables ..data All the data of the segment has been divided into spaces , however .bss The segment does not give space to the data in it .
This is an all zero memory segment , Initialize to 0 Global and static variables of are also stored here .
Pile up (.heap):
Store dynamically allocated memory , If you use malloc/calloc/realloc/new Allocated memory . Upward increase . Generally much larger than the stack . Need to free up space manually .
Memory mapping area of shared library :
Store dynamic library / Static library , And file mapping , Anonymous mapping and other dependent things .
Stack (.stack):
Store local variables , Parameters and return values of functions , And registers that need to remain unchanged before and after function calls ( Context ). Grow down . The operating system reclaims space by itself .

Reference resources :
https://blog.csdn.net/Code_beeps/article/details/89608929
(24 Bar message ) Talking about the memory layout of program _CSDN Information blog -CSDN Blog
边栏推荐
- Zero basic learning canoe panel (16) -- clock control/panel control/start stop control/tab control
- 卷积核越大性能越强?一文解读RepLKNet模型
- 交换机链路聚合详解【华为eNSP】
- 我在源头SQLServer里面登记绝对删除的数据,传到MaxComputer,在数据清洗的时候写绝对
- 我想问DMS有没有定时备份某一个数据库的功能?
- Can flinkcdc import multiple tables in mongodb database together?
- 全球都热炸了,谷歌服务器已经崩掉了
- JS convert pseudo array to array
- Selenium use -- installation and testing
- 网络空间安全 渗透攻防9(PKI)
猜你喜欢

Docekr学习 - MySQL8主从复制搭建部署

485 communication (detailed explanation)

2022.07.24(LC_6126_设计食物评分系统)

More accurate and efficient segmentation of organs-at-risk in radiotherapy with Convolutional Neural

【运维、实施精品】月薪10k+的技术岗位面试技巧

massCode 一款优秀的开源代码片段管理器

弹性盒子(Flex Box)详解

LeetCode 1184. 公交站间的距离

网络空间安全 渗透攻防9(PKI)
![[today in history] July 25: IBM obtained the first patent; Verizon acquires Yahoo; Amazon releases fire phone](/img/f6/d422367483542a0351923f2df27347.jpg)
[today in history] July 25: IBM obtained the first patent; Verizon acquires Yahoo; Amazon releases fire phone
随机推荐
flinkcdc可以一起导mongodb数据库中的多张表吗?
全球都热炸了,谷歌服务器已经崩掉了
conda常用命令:安装,更新,创建,激活,关闭,查看,卸载,删除,清理,重命名,换源,问题
LeetCode 1184. 公交站间的距离
【AI4Code】《Contrastive Code Representation Learning》 (EMNLP 2021)
【C语言进阶】动态内存管理
[shutter -- layout] stacked layout (stack and positioned)
MLX90640 红外热成像仪测温传感器模块开发笔记(五)
Business visualization - make your flowchart'run'(3. Branch selection & cross language distributed operation node)
想要做好软件测试,可以先了解AST、SCA和渗透测试
Substance Designer 2021软件安装包下载及安装教程
软件测试面试题目:请你列举几个物品的测试方法怎么说?
Kyligence was selected into Gartner 2022 data management technology maturity curve report
logstash
EMQX Cloud 更新:日志分析增加更多参数,监控运维更省心
Go: Gin custom log output format
massCode 一款优秀的开源代码片段管理器
Mysql 远程连接权限错误1045问题
Use of hystrix
AtCoder Beginner Contest 261 F // 树状数组