Data locality optimization through object relocation may be implemented in
a virtual machine including a just-in-time compiler. The just-in-time
compiler generates load instruction maps for each compiled method. A
profile collector is coupled to the just-in-time compiler to receive
hardware profiling support. The profile collector takes samples of data
cache misses. A garbage collector is coupled to the profile collector.
The garbage collector deduces types of objects from the cache miss
samples and adjusts garbage collection object copying heuristics to
relocate objects for better cache locality based on those types.