计算机应用 ›› 2015, Vol. 35 ›› Issue (12): 3368-3373.DOI: 10.11772/j.issn.1001-9081.2015.12.3368

• 先进计算 • 上一篇    下一篇

基于线段树的高效内存管理算法及其空间优化

王冬慧, 韩建民, 庄嘉琪   

  1. 浙江师范大学数理与信息工程学院, 浙江金华 321004
  • 收稿日期:2015-06-15 修回日期:2015-08-26 出版日期:2015-12-10 发布日期:2015-12-10
  • 通讯作者: 王冬慧(1995-),女,安徽天长人,主要研究方向:操作系统
  • 作者简介:韩建民(1969-),男,浙江金华人,教授,博士,主要研究方向:信息安全;庄嘉琪(1994-),男,温州乐清人,主要研究方向:操作系统。
  • 基金资助:
    国家自然科学基金资助项目(61170108,61402418);浙江省自然科学基金资助项目(LQ13F020007,LY15F020013)。

Efficient memory management algorithm based on segment tree and its space optimization

WANG Donghui, HAN Jianmin, ZHUANG Jiaqi   

  1. College of Mathematics, Physics and Information Engineering, Zhejiang Normal University, Jinhua Zhejiang 321004, China
  • Received:2015-06-15 Revised:2015-08-26 Online:2015-12-10 Published:2015-12-10

摘要: 现有的内存管理的工作多集中在内存分配的效率上,实时性较好,但易产生内存碎片。为此,提出基于线段树的高效内存管理方法。该方法将内存地址空间划分为内存段,建立内存管理线段树,基于所建立的内存管理线段树,进行高效灵活的内存分配和回收管理,减少了内存碎片的产生。另外,针对线段树空间开销大的问题,提出了线段树空间优化的方法。实验结果表明,所提出的内存管理方法,具有效率高、产生的内存碎片少、内存管理空间开销小等优势。

关键词: 内存管理, 线段树, 空间优化, 内存分配, 内存回收, 延迟更新, 二叉树

Abstract: Most existing works on memory management focus on the efficiency, which are real-time, but have memory fragmentation problems. To address the problem, an efficient memory management algorithm based on segment tree was proposed. The proposed method built a memory management segment tree by dividing memory space into segments, and allocated and reclaimed memory efficiently and flexibly based on the memory management segment tree to reduce the memory fragmentation. Furthermore, a method was proposed to optimize the space complexity of segment trees. The experimental results show that the proposed method has advantages in terms of efficiency, memory fragmentation, storage space, and so on.

Key words: memory management, segment tree, space optimization, memory allocation, memory reclaim, deferred update, binary tree

中图分类号: