The thing you missed is that C++ doesn&#x27;t allocate as many objects. For a start, a std::vector allocates exactly one &quot;object&quot;, namely the underlying buffer. All the elements are placed in this contiguous memory. When the buffer is full it is reallocated.