Along with the rise of novel big data and artificial artificial intelligence applications,the amount of data processed by computer systems is increasing at a rate higher that of Moore’s law.Data-intensive applications put forward higher demands for the storage of computer systems.The current DRAM-based main memory systems cannot meet the requirements in terms of integration density,energy consumption and performance,researchers are exploring new memory technologies for replacing DRAM as the new generation of main memory.Phase Change Memory(PCM)has received attention due to its high integration density,low leakage power,byte-addressability and non-volatility.However,PCM suffers from a write endurance problem,as it’s lifetime can be extremely short under skew writes.To mitigate this problem and prolong PCM’s lifetime,researchers have proposed various wear leveling techniques from hardware level,operating system level and program level,to spread the writes evenly among the entire memory area.This paper focuses on program level wear leveling,which aims at distributing the writes evenly by optimizing data access and write patterns at compiler-time or program’s runtime.Firstly,this paper analyzes the memory management schemes and the uneven wear in program’s virtual address space,and then puts forward two program level wear leveling approaches.(1)Wear leveling-aware memory allocation for both heap and stack.Traditionally,heap and stack have different memory management schemes but both would introduce the uneven wear problem.And there is a significant disparity between the wear degree of heap and stack since they are managed independently.This paper proposes a new wear leveling-aware memory allocator and applies it for both stack and heap memory allocation.This allocator preferentially allocates rarely-used memory blocks and freezes the memory blocks that have been allocated frequently.(2)Loop2Recursion,a compiler-time wear leveling approach for stack area。Loops in a program introduce the hot data and cause a large number of stack frames to be allocated for the same locations,resulting in the uneven wear in the stack.This paper proposes Loop2 Recursion,which transforms loops into recursions automatically at compiler-time,to alleviate the uneven wear.This paper also optimizes the stack memory usage for recursions,thus Loop2 Recursion provides a flexible tradeoff between wear leveling effectiveness and stack memory usage.Experimental results indicate that,both the approaches achieve satisfactory wear leveling effectiveness. |