javac: java.lang.OutOfMemoryError when running ant from Eclipse

前端 未结 5 858
天涯浪人
天涯浪人 2021-02-13 19:16

I have given loads of memory to eclipse in the ini file but its still not using anything more than 300mb which i can see in the task manager.

  [javac] The syst         


        
5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-13 19:56

    I had the same problem a week ago, and the solution was set fork attribute to true, to run javac in a separate process with its own heap size settings. If fork is set to false, or not set (default is false), javac will run in the same process as Ant. The following is a snippet from my current build.xml:

    
    

    Setting fork to true will also limit any memory leaks in javac implementation to its own child process, without affecting the parent Ant process. I read about this hint here

提交回复
热议问题