title: push_back objects into vector memory issue C++
body: <p>Compare the two ways of initializing vector of objects here.</p>
  
  <pre><code>1.
      vector&lt;Obj&gt; someVector;
      Obj new_obj;
      someVector.push_back(new_obj);
  
  2.
      vector&lt;Obj*&gt; ptrVector;
      Obj* objptr = new Obj();
      ptrVector.push_back(objptr);
  </code></pre>
  
  <p>The first one push_back actual object instead of the pointer of the object. Is vector push_back copying the value being pushed? My problem is, I have huge object and very long vectors, so I need to find a best way to save memory.</p>
  
  <ul>
  <li>Is the second way better?</li>
  <li>Are there other ways to have a vector of objects/pointers that I can find each object later and use the least memory at the same time?</li>
  </ul>