为了提高嵌入式系统内存动态分配效率,在分析经典内存分配算法和马尔可夫链预测原理的基础上,提出了一种嵌入式系统内存预测分配算法。该算法融合聚类分析法,利用内存分配的转移量统计信息及其概率矩阵对嵌入式系统内存动态分配进行预测。在实现中采用轻量级预测线程预测下一次申请的内存块大小,减少内存动态分配时等待内存创建的时间。通过增加预测线程的μC/OS-Ⅱ系统和未增加预测线程的μC/OS-Ⅱ系统进行对比实验,实验结果表明了该算法的可行性和高效性。
To increase the allocation efficiency of dynamic memory for embedded system,a new design forecast method of embedded memory allocation algorithm based on analysis of classical memory allocation algorithm and Markov chain prediction principle is presented.The algorithm is used to predict the embedded system memory dynamic allocation by transfer quantity statistics from the memory allocation and probability matrix,combined with the clustering analysis.In the algorithm realization,lightweight prediction thread is proposed to forecast the next application in memory so as to reduce time of waiting for creating memory when system allocates memory.By the experiment comparison between μC/OS-Ⅱ system with predicted thread and μC/OS-Ⅱ system with no predicted thread,it is verified that the proposed algorithm is feasible and efficient.