Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I increase Groovy's JVM Heap Size?

Some sources on the web claims that I should be able to give the -Xmx param to groovy but that just gives me java.io.FileNotFoundException when it can't find the -Xmx file. Other sources tell me to set some variable named JAVA_OPTS but how do I do that? And how do I know if it worked?

like image 732
jonalv Avatar asked Mar 28 '11 12:03

jonalv


People also ask

How do I set JVM heap size?

Under the Java tab, select JVM Options. Edit the -Xmx256m option. This option sets the JVM heap size. Set the -Xmx256m option to a higher value, such as Xmx1024m.

What is the maximum JVM heap size?

The theoretical limit is 2^64 bytes, which is 16 exabytes (1 exabyte = 1024 petabytes, 1 petabyte = 1024 terabytes). However, most OS's can't handle that. For instance, Linux can only support 64 terabytes of data. Note: We don't recommend you exceed 2 GB of in use JVM heap.


2 Answers

$ export JAVA_OPTS="$JAVA_OPTS -Xmx64M"
$ groovy
like image 200
Heiko Rupp Avatar answered Feb 07 '23 06:02

Heiko Rupp


UPDATED: Go to your Groovy home folder and go into the bin directory. In startGroovy.bat, you can set it from 128MB to 512MB like this:

...
@rem set GROOVY_OPTS="-Xmx128m"
set GROOVY_OPTS="-Xmx512m"
...
like image 21
crazy4groovy Avatar answered Feb 07 '23 08:02

crazy4groovy