We propose a novel container-centric memory management
and allocation scheme in which the container's semantics guide
the allocation of its elements. At compile time, the
container's semantics provide knowledge that is evaluated at
run-time and then used for more efficient memory clustering.
Our approach allows an application to use different allocation
policies for different types of containers, or even different
instantiations of the same type of container.
We have integrated Defero, our memory allocator, with the
C++ Standard Template Library (STL) containers, which allows us
to automatically use Defero for applications that use STL
containers and algorithms.
Results from our prototype implementation of Defero have been
very promising. We have used Defero in applications from molecular
dynamics, network simulation, and numerical methods on arbitrary
polygonal and polyhedral meshes.
Experimental results show that Defero reduces overall execution time
up to 32% for some applications. Stand-alone STL algorithms
have shown a reduction in execution time of up to 20 times when
using Defero allocated containers. These improvements can be mainly
attributed to decreased TLB misses, by up to 91% in some applications.