Techniques and tools for coallocating objects and/or object fields for the
sake of cache performance are described. For example, a tool improves
cache performance by coallocating contemporaneously accessed heap
objects. The tool analyzes object accesses to identify hot data streams
in a profile run of a program. The tool directs allocations for objects
in a given hot data steam to the same sequentially allocated arena,
separating intervening allocations coming from other allocation sites.
The tool enforces the solution by redirecting heap allocations to a
run-time coallocation library. The tool and analysis extend to
coallocation at object field granularity. The resulting field
coallocation solution generalizes common data restructuring techniques
and provides insight into object restructuring by breaking down the
coallocation benefit on a per-technique basis.