基于嵌入式系统的内存管理方案-电路与系统专业论文.docxVIP

  • 1
  • 0
  • 约5.25万字
  • 约 55页
  • 2019-03-28 发布于上海
  • 举报

基于嵌入式系统的内存管理方案-电路与系统专业论文.docx

杭州电子科技大学 硕士学位论文 基于嵌入式系统的内存管理方案 姓名:丁锐 申请学位级别:硕士 专业:电路与系统 指导教师:张亚君 201111 杭州电子科技大学硕士学位论文摘要 杭州电子科技大学硕士学位论文 摘要 随着嵌入式技术的不断发展,嵌入式系统在人们的社会生活中得到了广泛的应用。针对 嵌入式系统内存分配具有高效性、可靠性和实时性等要求,每种嵌入式系统结合自己的实际 应用情况,都采用自己的内存管理方案。 PTmalloc作为当前嵌入式系统的主流内存管理方案,其稳定性、全面性等特点决定了其 在嵌入式系统中的地位。但PTmalloc对多线程情况下大批量的内存申请、释放的处理速度不 能很好的满足路由器等设备的要求,并可能造成极大的内存空间浪费。本文从PTmalloc的基 本原理出发分析了PTmalloc的优点和缺点,得出了PTmalloc对大批量内存处理速度慢的原 因:arena与线程不是严格的一一对应,从而导致了频繁的加解锁操作。 Tcmalloc作为应用于服务器的内存管理方案,其对多线程情况下大批量的内存申请、释 放的处理速度能很好的满足路由器等设备的要求。本文从tcmalloc的基本原理出发分析了 tcmalloc的优点和缺点,得出了tcmalloc会导致嵌入式系统所不能容忍的内存浪费。 本文结合PTmalloc与tcmalloc的优、缺点,提出了一种新的内存管理方案,主要体现 在以下几个方面: 1)以tcmalloc的多级缓存为基本框架,引用PTmalloc的切割方式来实现内存块的切割; 2)根据实际的应用情况,细化内存块的分类: 3)引入缓存控制机制来控制缓存,降低内存浪费; 4)提供内存诊断功能来用于帮助解决非法内存操作而导致的各种bug: 通过在实际设备上的测试,本内存管理方案对多线程情况下大批量内存申请、释放的处 理速度要比PTmalloc好,内存缓存而导致的内存浪费情况得到了很好的解决。 关键词:内存管理;多级缓存;PTmalloc;tcmalloc ABSTRACTWith ABSTRACT With the development of eI】medded system,the embedded system ale used in the society widely.The requirement for real—time,reliability,high efficiency,makes lots of embedded system applications using their own memory managing methods. PTmalloc is widely used in embedded system because of its stability and the character of comprehensiveness.In the condition of large quantities by multiple threads,the requirement of routers Can not be satisfied,and the bad waste of memory will be occurred.This paper will analyze the reason for the default when handle large quantities by multiple threads,the arena cache can not be used by only one thread strictly SO that it will bring the operation of locking and u1110cl(jng frequently,which will waste large amount of time. Tcmalloc is widely used in servers,the perfect management of large quantities by multipIe threads Can satisfy the router’s requirement perfectly. But the disadvantage of tcmalloc will be analyzed in this paper,which is the large waste ofmemory. This paper gives a new memory allocating method based on the PTmalloe and tcmalloc,s advantages as follows: 1)Using the

文档评论(0)

1亿VIP精品文档

相关文档