how to increase ant permgen size? I have given in ANT_OPTS as
-Xms768m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=128m
question 1)After specifying above setting in system environment, still i am getting outof memeory error for ant target for junit.
Caught an exception while logging the end of the build. Exception was: java.lang.OutOfMemoryError: PermGen space
2) when i type in command promt to see what is path for ant_opts, echo %ant_opts% it shows only
-Xmx512m
and other parts skips. is something wrong in my path? Note: i am using command prompt to run ant target.
To increase PermGen, we have the following commands: -XX:PermSize=N - sets the initial (and minimum size) of the Permanent Generation space. -XX:MaxPermSize=N - sets the maximum size of the Permanent Generation space.
You can set the minimum and maximum memory heap size with the JVM -Xms and -Xmx parameters, for example, setting the minimum heap size to 128 MB and the maximum heap size to 1024 MB. Let's first understand what -Xms, -Xmx, -XX:PermSize and -XX:MaxPermSize are, -Xmx<size> - Set initial Java heap size.
go to my computer->right click->properties->Advanced->environment variables->New(in system/user variable)->
enter
Varible name: ANT_OPTS Varible Value : -Xms1536m -Xmx1536m -XX:PermSize=1024m -XX:MaxPermSize=2048m
Note:
configure values according to your system memory size.
This config for windows, for other OS config accordingly
For MAC:
in Terminal, goto pom.xml path in project, run below command:
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=512m" Note: Size is based on system RAM. I used maven instead of old Ant. use MAVEN_OPTS/ANT_OPTS for maven/ant config.
What does your test do? Does it call a recursive method?
Also, the values that you enter for your test will override any system setting. Try this in your call to junit in your Ant script:
<junit fork="yes" maxmemory="1024">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With