摘要
对多种不同的动态内存分配算法的特点与优劣进行对比、分析,在兼顾效率和内存碎片率指标的要求下,提出了基于multimap映射的动态内存分配算法。该算法以内存块的大小作为键,内存块的地址信息作为值,以键值对的形式存储内存块的地址,并在内存块实体的首部与尾部添加标识信息。为检验算法效果,设计了多组数据对新算法和现有经典内存管理算法效率进行比较,实验结果表明新算法在降低时间开销,保留较大连续空间,减少内存碎片等方面具有较明显的改善。
Under the consideration of efficiency and memory fragments indictors, a variety of dynamic memory allocation algorithms were compared and analyzed, and a new dynamic memory allocation based on multimap was proposed. The algorithm put the size of the memory block as the key and the address of the memory block as the value, used the key-value pair to store the address of memory block, and added the boundary tag at both the head and tail of memory block. In order to verify the performance of new algorithm, multiple sets of experiment data were tested on new algorithm and existing classic algorithms of memory allocation.The experiment results show that the new algorithm has obviously improved on time cost, keeping large contiguous space and memory fragments reduction.
出处
《电脑知识与技术》
2016年第10X期222-224,共3页
Computer Knowledge and Technology
基金
基于Android平台的教室使用情况监测软件(项目编号:201510378570)