当前位置:主页 > 科技论文 > 计算机论文 >

嵌入式实时系统动态内存分配管理器的设计与实现

发布时间:2018-02-08 22:37

  本文关键词: 动态内存分配 TLSF算法 内存管理器 嵌入式实时系统 出处:《重庆大学》2013年硕士论文 论文类型:学位论文


【摘要】:随着物联网技术的发展,嵌入式实时操作系统得到越来越广泛的应用。嵌入式实时操作系统对动态内存分配的实时性、碎片率、可靠性有更高的要求,因此,动态内存分配已成为嵌入式实时操作系统的一个重要研究内容。现有内存管理一般通过牺牲内存利用率来满足实时性要求,造成了内存资源浪费。此外,由于嵌入式系统处理器一般没有内存管理单元,实时操作系统的内存管理无法对内存进行保护,,易造成内存越界访问,降低系统的可靠性。为此,改善内存利用率和内存安全保护功能对于提供动态内存分配性能具有重要意义。 本文针对上述问题,在嵌入式实时系统内存管理算法TLSF(Two-levelSegregated Fit)基础上,针对其内存分配和释放时的不足,以及在内存保护方面的缺陷,研究了在不降低系统实时性的前提下降低内存碎片率的方法,通过加入二级位图算法,提出新的数据结构,添加内存越界访问保护机制,完成了一种新的嵌入式实时系统动态内存管理器ERMM(Embedded Real-time Memory Manager)的设计。主要工作包括: 1)分析了常用嵌入式实时操作系统的动态内存管理算法,对不同的动态内存分配算法(DSA)的实时性及内存碎片率进行了讨论,根据嵌入式实时系统的对实时性及内存碎片率的要求,提出了以TLSF算法为基础的嵌入式实时系统动态内存管理器内存管理方案。 2)通过对TLSF算法进行详细分析,提出了一个新的嵌入式实时系统动态内存分配管理器(ERMM)。针对TLSF算法在小内存分配时效率较低的缺点,提出新的数据结构,对不同大小的内存请求采取不同的分配策略。对小内存请求,采取二级位图算法加快查找速度,并通过以空间换时间的策略降低分配时间,减少外部内存碎片;对大内存请求,采用改进TLSF算法:对其内存分配的“取下限”切割策略,提出“精确切割”的改进策略,降低内部内存碎片率;对其内存释放时空闲内存块“立即合并”策略,提出“延时合并”的改进策略,提高实时性;在可靠性方面,采取内存越界保护等措施提高内存管理的安全性。 3)将TLSF算法及ERMM在μC/OS-Ⅲ系统上进行实现,在内存碎片率及实时性方面对这两种方法进行实验对比,并对ERMM的内存安全性进行测试。实验结果表明,ERMM动态内存分配管理器具有较好的实时性、较高的可靠性及较低的内存碎片率,可有效提高嵌入式实时系统内存管理的性能。
[Abstract]:With the development of Internet of things technology, embedded real-time operating system is more and more widely used. Embedded real-time operating system has higher requirements for real-time, fragmentation and reliability of dynamic memory allocation. Dynamic memory allocation has become an important research content in embedded real-time operating system. The existing memory management usually sacrifices the memory utilization to meet the real-time requirements, which results in the waste of memory resources. Because the embedded system processor generally has no memory management unit, the memory management of the real-time operating system can not protect the memory, which can easily cause the memory to cross the boundary and reduce the reliability of the system. Improving memory utilization and memory security protection is important to provide dynamic memory allocation performance. In order to solve the above problems, based on the memory management algorithm TLSF(Two-levelSegregated Fit, this paper aims at the shortcomings of memory allocation and release, as well as the defects in memory protection. This paper studies the method of reducing the memory fragmentation rate without reducing the real-time performance of the system. By adding a two-level bitmap algorithm, a new data structure is proposed, and a memory access protection mechanism is added. A new embedded real-time system dynamic memory manager, ERMM(Embedded Real-time Memory Manager, is designed. The main work includes:. 1) the dynamic memory management algorithms of common embedded real-time operating systems are analyzed, and the real-time performance and memory fragmentation rate of different dynamic memory allocation algorithms (DSAs) are discussed. According to the requirement of real-time and memory fragmentation rate of embedded real-time system, a memory management scheme of dynamic memory manager for embedded real-time system based on TLSF algorithm is proposed. 2) based on the detailed analysis of the TLSF algorithm, a new dynamic memory allocation manager for embedded real-time system is proposed. Aiming at the low efficiency of the TLSF algorithm in small memory allocation, a new data structure is proposed. For small memory requests, the secondary bitmap algorithm is adopted to speed up the lookup speed, and to reduce the allocation time and reduce the external memory fragmentation by using the strategy of changing space for time, and for large memory requests, the second level bitmap algorithm is adopted to speed up the search speed for the small memory requests with different memory requests of different sizes. The improved TLSF algorithm is adopted: the "lower limit" cutting strategy for its memory allocation, the improved "accurate cutting" strategy to reduce the internal memory fragmentation rate, and the "immediate merge" strategy for the free memory blocks when the memory is released. The improved strategy of "delay merging" is put forward to improve the real-time performance, and in the aspect of reliability, the security of memory management is improved by taking measures such as memory overstepping protection and so on. 3) the TLSF algorithm and ERMM are implemented on 渭 C / OS- 鈪

本文编号:1496439

资料下载
论文发表

本文链接:https://www.wllwen.com/kejilunwen/jisuanjikexuelunwen/1496439.html


Copyright(c)文论论文网All Rights Reserved | 网站地图 |

版权申明:资料由用户12d55***提供,本站仅收录摘要或目录,作者需要删除请E-mail邮箱bigeng88@qq.com