title: java - increasing heap space to maximum limit
body: <p>So I am using intellij and working on a program. I left my VM options empty and ran the program, it throws <code>outofmemory:java heap space</code> exception.</p>
  
  <p>So I decided to ramp up the heap space, by adding <code>-Xmx1024m</code>. The program runs halfway and then it throws the same error again. I am basically trying to extract words from a pdf document (has 10 million words) so that's a big file. </p>
  
  <p>I tried increasing the value to <code>5000m</code> but it says <code>invalid maximum heap size the specified size exceeds maximum representable size</code> . Does anyone know what is the maximum possible size i specify the value so it can run my program completely?</p>