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?
相关问题
- Grails External Configuration. Can't access to
- Java 7 G1GC strange behaviour
- Can I override cast operator in Groovy?
- Use Groovy to Sort XML File
- How to run python commands using groovy in Jenkins
相关文章
- Using Spring Dynamic Languages Support from Groovy
- Grails: How to make everything I create Upper Case
- Groovy Java 9 modules support
- Groovy: What's wrong with this “Hello World” p
- Create WS security headers for REST web service in
- Groovy can't compile the code from a solution
- How to set Jenkins Declarative Pipeline environmen
- Dynamically scheduling jobs: using cron trigger in
Found another way to do this on Windows without having to modify JAVA_OPTS, etc. Go to your Groovy home folder and go into the bin directory. If you are invoking Groovy by calling the groovy.bat file, if you look inside it, you'll see it in turn runs startGroovy.bat. In startGroovy.bat, in the last lines of the script, you'll find something like this:
Add the Xmx switch and memory you need allocated after %JAVA_OPTS% and before -classpath, so you have something like this:
Now when you go to run Groovy, the -Xmx value will be the allocated memory it uses. Nice thing about this approach is that you don't need to re-load your env variables every time you want to change heap size and you have fine-grained control over what you're doing with the JVM that Groovy is utilizing.
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: