Out of memory error in ant

前端 未结 2 775
没有蜡笔的小新
没有蜡笔的小新 2021-01-05 05:13

I am trying to run ant task, however I get the following error:

[javadoc] javadoc: error - java.lang.OutOfMemoryError: Please increase memory.
[javadoc] For          


        
相关标签:
2条回答
  • 2021-01-05 05:51

    The javac ant task has the attribute memoryMaximumSize which you should set to the same value as you would for -Xmx.

    <javac memoryMaximumSize="256m" ...>
      ...
    </javac>
    

    I should add that this assumes that it is indeed a javac task that's causing the memory overrun.

    0 讨论(0)
  • 2021-01-05 05:53

    I solved it.

    It had nothing to do with little memory. It was an endeless loop in my javadoc generation.

    The correct way of setting more memory for ant is by using export ANT_OPTS=-Xmx256m on *nix.

    On Windows follow the usual steps for setting environment variables.

    0 讨论(0)
提交回复
热议问题