如何增加蚂蚁 permgen 的大小? [英] how to increase ant permgen size?
问题描述
如何增加 ant permgen 的大小?我在 ANT_OPTS 中给出了
how to increase ant permgen size? I have given in ANT_OPTS as
-Xms768m -Xmx1024m -XX:PermSize=128m-XX:MaxPermSize=128m
-Xms768m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=128m
问题1)在系统环境中指定上述设置后,我仍然为junit的ant目标出现内存溢出错误.
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) 当我输入命令提示符以查看 ant_opts 的路径时,echo %ant_opts% 只显示
2) when i type in command promt to see what is path for ant_opts, echo %ant_opts% it shows only
-Xmx512m
和其他部分跳过.我的路径有问题吗?注意:我正在使用命令提示符来运行 ant 目标.
and other parts skips. is something wrong in my path? Note: i am using command prompt to run ant target.
推荐答案
转到我的电脑->右键->属性->高级->环境变量->新建(在系统/用户变量中)->
go to my computer->right click->properties->Advanced->environment variables->New(in system/user variable)->
进入
Varible name: ANT_OPTS
Varible Value : -Xms1536m -Xmx1536m -XX:PermSize=1024m -XX:MaxPermSize=2048m
注意:
根据您的系统内存大小配置值.
configure values according to your system memory size.
此配置适用于 Windows,适用于其他操作系统的相应配置
This config for windows, for other OS config accordingly
对于 MAC:
在终端中,转到项目中的 pom.xml 路径,运行以下命令:
in Terminal, goto pom.xml path in project, run below command:
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=512m" 注意:大小基于系统 RAM.我使用 maven 而不是旧的 Ant.使用 MAVEN_OPTS/ANT_OPTS 进行 maven/ant 配置.
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.
这篇关于如何增加蚂蚁 permgen 的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!