Increasing the JVM heap size

You can increase the size of the JVM heap to fix out-of-memory errors.

The Java manipulator runs under the control of the JVM (Java virtual machine) on your computer. If the Java manipulator requires a large amount of memory, it is possible that the JVM will begin to throw OutOfMemoryError instances when attempting to instantiate objects. The following ERROR log entry is an example:
Exception in thread "main" java.lang.Error: Error was thrown at record: 13352
at com.endeca.edf.termextractor.TermExtractor
  $ExtractifiedRecordHandlerSource.produceNextEr
  (TermExtractor.java:711)
...
at com.endeca.edf.adapter.AdapterRunner.main
  (AdapterRunner.java:221)
Caused by: java.lang.OutOfMemoryError: Java heap space

As the final line of the log entry indicates, the problem was caused because the Java heap space is too small.

Java has options that help control how much memory it uses:

The default size for these values is measured in bytes. Append the letter K (or k) to the value to indicate kilobytes, M (or m) to indicate megabytes, and G (or g) to indicate gigabytes.

You then use the Forge --javaArgument flag to pass in the JVM heap size setting to Forge, as in this example that sets the JVM heap size to a maximum of one gigabyte:
--javaArgument -Xmx1G

Make sure that the heap size is not larger than the available free RAM on your system.

Note that if you want to pass in multiple Java options, you must use a separate --javaArgument flag for each option.