Each time you are resizing the vector (by calling resize() or push_back()) and new size is bigger then capacity you are facing the memory reallocation and probably memory moving.

So if you are...