Increase memory for ant

13,148

you have strange configuration - PermGen size is four times bigger than a Heap. Maybe it is a typo? Try this:

set ANT_OPTS=-Xmx2G -XX:MaxPermSize=512m

But there is no much to do with ant - big project needs a long time to build. Do not forget, that this process can consume much CPU (then it's good idea to make ant use multiple threads by parallel tasks or custom runtime) or have HDD bottleneck (consider using SSD or even RAM drive in this case)

Share:
13,148

Related videos on Youtube

sharkbait
Author by

sharkbait

I born very young. I never understood the passive periphrastic. I love binary code. I'm hungry. #SOreadytohelp

Updated on June 04, 2022

Comments

  • sharkbait
    sharkbait almost 2 years

    I have an issue about memory usage. I had 8 GB of RAM and I had my ant settings like this:

    set ANT_OPTS=-Xmx512m -XX:MaxPermSize=2G
    

    Now, I have installed 16 GB of RAM but when I run an ant clean all, this take the same time to compile.

    How I have to set the options to increase memory and speed? I have Windows 7 64bit and 16 GB RAM. I use Eclipse, but I run ant clean all and server Tomcat from the cmd.

  • sharkbait
    sharkbait about 8 years
    Good I passed from 20 minutes to 7 minutes for an ant clean all
  • Cootri
    Cootri about 8 years
    nice, I'm glad it helped :)
  • vissu
    vissu over 4 years
    Hey! I am trying to run ant rebuild command from command line. Unfortunately it is taking ~40 min every time. I am using JBoss server so every time I run rebuild and deploy to jboss and start jbos taking ~one hour. Can I speed it up by setting ANT_OPTS ? my machine is 32G ram.