In my code, if I call vector::reserve(capacity) and allocate more capacity than what I actually need for the vector to hold the elements, then during the running of my program, will the vector always holds the memory, not releasing resource and costs? If so, isn't that kind of memory waste?
Can I risk trying to lower the reserve capacity to the anticipated size of vector and would that make the program run robust and maybe faster?
Would this lower the possibility of running out of memory?
I ran the code on the mobile phone with high computative load tasks, so still need to consider memory overhead.