Mostly technical stuff with some interesting moments of life

Increase Java Heap Memory for Maven

3 comments
If you ever encounter an error saying Java heap is not enough, while building a project using Maven, the following content will help to get out of it. Thanks Charitha for finding this.

Set the MAVEN_OPTS system property,

e.g. MAVEN_OPTS=-Xmx1024m  will give you 1024 Mb heap

3 comments :

  1. Replies
    1. Indeed Nice tip. I am increasingly using Maven for managing dependency despite having biased on ANT earlier. I have also shared How to increase Heap size in Maven and ANT you find useful.

      Delete
  2. Yeah, you can set the min-max range as well... using -Xms for min, and -Xmx for max. Btw, these are VM args and can be specified at maven, ant, or any other way in which you can specify VM args.

    Regards,
    Senaka

    ReplyDelete