Exceptions such as "java.lang.OutOfMemoryError" indicate that a heap has reached its maximum size. You can specify the number of bytes directly or use the suffix "MB" to indicate megabytes, for example, specifying "64MB" is the same as specifying "67108864."
This sets the max java heap size, specify the size in bytes OR MB
Example : JavaMaxHeapSize=67108864 or JavaMaxHeapSize=64mb
An exception like java.lang.OutOfMemoryError is a warning that you might need to increase the heap space.
For r6 users see also JavaMinHeapSize
Note: The default number of bytes is 67,108,864 (64MB). Note that this is the maximum size, not the initial size. (Currently, there is no way to set the initial size.) The JVM starts out at 1MB of heap space, most of it uncommitted. If the JVM needs more heap space than it currently has, it expands the heap in increments, although it will not exceed the maximum. An exception like java.lang.OutOfMemoryError is an indication of maxed-out heap space.