title: Map causing Seg Fault. How to increase memory?
body: <p>I have a simple question.  I have a few files, one file is around ~20000 lines.<br>
  It has 5 fields, have some other adt (vectors and lists), but those do not cause a segfault.
  The map itself will store a key value, equivalent to about 1 per line.
  When I added a map to my code, I would instantly get a segfault, I copied 5000 of 20000 lines, and receive a segfault, then 1000, and it worked.</p>
  
  <p>In java there is a way to increase the amount of virtually allocated memory, is there a way to do so in c++?  I have even deleted elements as they are no longer used, and I can get around 2000 lines, but not more.</p>
  
  <p>Here is gdb:</p>
  
  <pre><code>(gdb) exec-file readin
  (gdb) run
  Starting program: /x/x/x/readin readin
  
  Program exited normally.
  </code></pre>
  
  <p>valgrind:</p>
  
  <pre><code>HEAP SUMMARY:
  ==7948==     in use at exit: 0 bytes in 0 blocks
  ==7948==   total heap usage: 20,206 allocs, 20,206 frees, 2,661,509 bytes allocated
  ==7948== 
  ==7948== All heap blocks were freed -- no leaks are possible
  </code></pre>
  
  <p>code:</p>
  
  <pre><code> ....
   Flow flw = endQueue.top();
    stringstream str1;
    stringstream str2;
    if (flw.getSrc() &lt; flw.getDest()){
      str1 &lt;&lt; flw.getSrc();
      str2 &lt;&lt; flw.getDest();
      flw_src_dest = str1.str() + "-" + str2.str();
    } else {
      str1 &lt;&lt; flw.getSrc();
      str2 &lt;&lt; flw.getDest();
      flw_src_dest = str2.str() + "-" + str1.str();
    }    
  while (int_start &gt; flw.getEnd()){
    if(flw.getFlow() == 1){
      ava_bw[flw_src_dest] += 5.5;
    } else {
      ava_bw[flw_src_dest] += 2.5;
    }
    endQueue.pop();
  } 
  </code></pre>