Techniques are described for optimizing memory management in a processor
system. The techniques may be implemented on processors that include
on-chip performance monitoring and on systems where an external
performance monitor is coupled to a processor. Processors that include a
Performance Monitoring Unit (PMU) are examples. The PMU may store data on
read and write cache misses, as well as data on translation lookaside
buffer (TLB) misses. The data from the PMU is used to determine if any
memory regions within a memory heap are delinquent memory regions, i.e.,
regions exhibiting high numbers of memory problems or stalls. If
delinquent memory regions are found, the memory manager, such as a
garbage collection routine, can efficiently optimize memory performance
as well as the mutators performance by improving the layout of objects in
the heap. In this way, memory management routines may be focused based on
dynamic and real-time memory performance data.