[Ant]Solutions of outOfMemory when run ant

来源:互联网 发布:java自动发送短信sms 编辑:程序博客网 时间:2024/06/06 05:09
there are 2  solutions:
1、in linux server, edit ant
  java -Xms128m -Xmx256m -classpath "%ANTCLASSPATH%" org.apache.tools.ant.Main %ANT_ARGS%
ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath \"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\" -Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"$CLASSPATH\" $ant_exec_args"
change to
ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -Xms128m -Xmx512m -classpath \"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\" -Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"$CLASSPATH\" $ant_exec_args"
 
2、when you run ant in eclipse, configure parameter follow as:
in build.xml  right-hand button->Run as->Extenal Tools Configurations->JRE Vmargument  add-Xms128m -Xmx512m there, you can solve this problem.

原创粉丝点击