4

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
  • 2,980
  • 16
  • 51
  • 89

1 Answers1

7

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)

Cootri
  • 3,806
  • 20
  • 30
  • Good I passed from 20 minutes to 7 minutes for an ant clean all – sharkbait Mar 31 '16 at 10:39
  • 1
    nice, I'm glad it helped :) – Cootri Mar 31 '16 at 10:43
  • 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. – vissu Sep 30 '19 at 08:10