FaqOutofMemoryOnCompile

I get an OutOfMemoryError while building a project having more than 6000 source files. What do I do?

You need to increase the memory allocated to the compiler. In order to do this:

  1. Right click on the project node in the Projects window and select Properties
  2. In the project properties dialog, click on Build | Compiling
  3. In the Additional Compiler Options text box, enter the -Xmx and optionally -Xms switches as needed (for example, -J-Xms=128m -J-Xmx=512m). For JDK 6, refer to http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html.
  4. Click OK in the dialog
  5. Make sure the external javac compiler will be used, by adding the following line to nbproject/project.properties from the Files tab:
build.compiler=extJavac

That should resolve the issue.


Applies to: since NetBeans 5.0

Platforms: All

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo