Resolving Java Heap Space Error

My previous code processed two tables with thousands of rows and had problem with Java Heap Space like shown below:

 

 

To overcome this out of memory problem, we should increase the heap size by typing this on command prompt:

 

And now it works:

 

More useful links about Java heap space:

  1. http://javarevisited.blogspot.com/2011/09/javalangoutofmemoryerror-permgen-space.html
  2. http://javarevisited.blogspot.com/2011/05/java-heap-space-memory-size-jvm.html
  3. http://stackoverflow.com/questions/1565388/increase-heap-size-in-java
  4. http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html
  5. http://viralpatel.net/blogs/jvm-java-increase-heap-size-setting-heap-size-jvm-heap/
  6. http://www.devx.com/tips/Tip/5578
  7. http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac55070_.htm
  8. http://www.ehow.com/how_5347474_set-java-heap-space.html
Advertisements