程序中的bss段,data段,代码段(.text),堆(heap),栈(stack)

come from:https://www.cnblogs.com/nibuyaoni/p/5724013.html

.bss段:程序中未初始化的和已经初始化为0的全局变量和已经初始化为0的静态局部变量(static)

.data段:程序中已经初始化的非零的全局变量和已经初始化的非零的静态局部变量(static)

代码段:用来存放代码的地方(.text段),不可修改,存放在只读区域内。

堆:程序员自己申请的内存区域,也就是用malloc()函数申请的内存区域,用free()函数来释放的区域。

栈:存放局部变量的区域,函数中的局部变量都是存放在栈中。

 

由SRAM的内存框图我们大概可以知道:栈在内存的最上区域,全局变量(数据段)在中间,(ZI段)bss段和堆(heap)在最下面的区域

注意:我们也可以自己写代码测试一下,每一种变量具体放在内存的哪个区域内。

 

come from : linux system environment programming

A virtual memory scheme splits the memory used by each program into small, fixed-size units called pages.

Correspondingly, RAM is divided into a series of page frames of the same size.

At any one time, only some of the pages of a program need to be resident in physical memory page frames; these pages form the so-called resident set.

Copies of the unused pages of a program are maintained in the swap area—a reserved area of disk space used to supplement the computer’s RAM—and loaded into physical memory only as required.

When a process references a page that is not currently resident in physical memory, a page fault occurs, at which point
the kernel suspends execution of the process while the page is loaded from disk into memory.

 

 

详细请看:https://blog.csdn.net/ywcpig/article/details/52303745

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值