内存free的疑问

sevenbamboos 2004-11-12 03:48:10
...that free memory remains allocated to the process. However, if it’s not being
used, the Linux memory manager will be able to page it out from physical memory to swap space,
...
Remember that once you’ve called free on a block of memory, it no longer belongs
to the process. It’s not being managed by the malloc library.

出自beginning linux programming的Data Management小节,不大理解allocated to the process
却又no longer belongs to the process,还有就是所谓的linux memory manager和malloc library
的关系,请指教
...全文
60 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
afantict 2004-11-12
  • 打赏
  • 举报
回复
老大,断章取义
我看中文版才发现,你翻译的不对
你重新好好看看就发现不是你想的那样子的
2,这种方式是系统的内存管理,就是free后,自由内存就交给malloc去管理了
1:这种方式书上指的是如果不用系统管理内存,而用进程管理内存的话出现的情况。这个时候,内存被free后,仍然属于这个进程,但是由于这块内存不被是用,会被从物理内存交换到交换分区里面。
winux0 2004-11-12
  • 打赏
  • 举报
回复
Remember that once you’ve called free on a block of memory, it no longer belongs
to the process.
释放掉了,当然不属于进程了

malloc library只是个库,需要系统调用来申请释放内存
memory manager负责内存管理,把一些不常用的内存交换到交换空间,还有在缺页的时候将内存读入等繁琐的工作

内存管理太复杂了,一两句说不清楚

23,120

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧