
On Tue, May 14, 2013 at 3:54 AM, Oodini
They are not originally vectors of vectors. The data come from a database, and are serialized in Python. So no C++ and Boost.Inteprocess.
Graphical user interface toolkits typically have methods that ask, "How much screen space do you require?" Container panels implement this by recursively querying their contents and then adding their own overhead. But I've never heard of a C++ container library that predictively does the same for memory consumption: "Given such-and-such content, how many bytes of memory *would* you require?" I can see that for certain use cases, that could be very handy, especially in embedded or realtime systems. I suspect, though, that the eventual solution to this particular problem will be a higher-level interface to shared memory that can grow or shrink the resource as needed. For right now, I can only suggest that you overallocate and hope for the best. I will be delighted to hear better suggestions from others!