Profiling Data Structures in Java and C++