摘要
文章研究和分析了通用内存分配器PTMAlloc2和TCMalloc的特点,通过借鉴现有通用内存分配器的优秀设计思想,提出了一种基于多级缓存的内存分配器MCMalloc。通过在不同层级上分配缓存,极大地减少锁的使用,降低锁竞争,提升了高并发系统的内存分配性能,并且支持不同层级之间的内存回收和同层级之间的内存迁移,避免内存分配效率恶化,提升了内存分配器的稳定性。通过TCMalloc官网数据和MCMalloc实验结果分别与PTMalloc2对比分析,在高并发场景下MCMalloc比TCMalloc能更好地改善了内存操作性能。
Based on the research and analysis of the general memory allocators PTMAlloc2and TCMalloc,This paper proposes a memory allocator MCMalloc(Multi-level Cache Malloc)based on multi-level cache by drawing on the excellent design ideas of the existing general memory allocator.By allocating cache at different levels,the use of lock is greatly reduced,lock competition is reduced,and the memory allocation performance of the high-concurrency system is improved.Memory migration between different levels or between the same levels is supported to avoid memory allocation efficiency deterioration.It supports memory recycling between different levels and memory migration between the same level to avoid memory allocation efficiency deterioration and improve the stability of the memory allocator.The TCMalloc official website data and MCMalloc experimental results were compared with PTMalloc2respectively.In high concurrency scenarios,MCMalloc improved the memory operation performance better than TCMalloc.
作者
张华
刘晶晶
Zhang Hua;Liu Jingjing(The 28th Research Institute of China Electronics Technology Group Corporation,Nanjing 210007,China)
出处
《信息化研究》
2020年第1期70-75,共6页
INFORMATIZATION RESEARCH