问下 建链表会不会造成大量内存碎片
时间:2011-12-27
来源:互联网
如果我定义链表
struct a{
int n;
struct *next;
};
如果我需要建立一个几亿级别的链表,会不会造成大量的内存碎片
有没有比较好的方法
我想写个内存修改器,需要记录搜索的内存地址
struct a{
int n;
struct *next;
};
如果我需要建立一个几亿级别的链表,会不会造成大量的内存碎片
有没有比较好的方法
我想写个内存修改器,需要记录搜索的内存地址
作者: flyrack 发布时间: 2011-12-27
自己试一下就知道啦。
作者: taodm 发布时间: 2011-12-27
怎样试啊??大神说明一下可以吗??真心不懂
作者: zwb8848happy 发布时间: 2011-12-27
内存碎片又分为内部碎片和外部碎片
Internal fragmentation occurs when an allocated block is larger than the payload. This might happen for a number of reasons. For example, the implementation of an allocator might impose a minimum size on allocated blocks that is greater than some requested payload.
Internal fragmentation is straightforward to quantify. It is simply the sum of the differences between the sizes of the allocated blocks and their payloads. Thus, at any point in time, the amount of internal fragmentation depends only on the pattern of previous requests and the allocator implementation
External fragmentation is much more difficult to quantify than internal fragmentation because it depends not only on the pattern of previous requests and the allocator implementation, but also on the pattern of future requests.
Internal fragmentation occurs when an allocated block is larger than the payload. This might happen for a number of reasons. For example, the implementation of an allocator might impose a minimum size on allocated blocks that is greater than some requested payload.
Internal fragmentation is straightforward to quantify. It is simply the sum of the differences between the sizes of the allocated blocks and their payloads. Thus, at any point in time, the amount of internal fragmentation depends only on the pattern of previous requests and the allocator implementation
External fragmentation is much more difficult to quantify than internal fragmentation because it depends not only on the pattern of previous requests and the allocator implementation, but also on the pattern of future requests.
作者: AnYidan 发布时间: 2011-12-27
作者: yafeng_jiang 发布时间: 2011-12-27
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28