This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Some users are complaining that they run into OutOfMemoryError when building in Netbeans. This can be resolved (I hope) with setting ANT_OPTS=-XmxSOMETHING, where SOMETHING is high enough number of megabytes, e.g. 256m. Maybe it would make sense to set something like ANT_OPTS=256m in launcher. I am just afraid that setting it high by default might cause problems to users with not enough RAM. :( What do you think about it, Jesse?
Ant runs in-VM; ANT_OPTS is for the command-line. The heap is that provided to the IDE. I think it's up to JRE ergonomics to set an appropriate default heap size.
I'm running on Debian Sarge JDK 1.5.0_05 NB 200511081900 And yes I'm running out of memory with a compile. In the Addtional Compiler Options, I'm specifying -J-Xmx512m and javac says it's an invalid option. How do we get over this hump? -B
For OOME's that are intrinsic to Ant processing, you just need to give the IDE itself more memory, e.g. in netbeans.conf. For compiler-related OOME's, you can pass VM args *if* you are using an external process for the compiler. By default, Ant runs javac in-VM. To use an external process, either 1. Use a non-default Java Platform, in the case of a plain Java project, if that makes sense. 2. Or, set build.compiler=extJavac in project.properties (or private.properties) of a plain Java project, to force Ant to spawn a process for javac. 3. For freeform projects or other Ant scripts, you can set build.compiler=extJavac somehow, or use other options available on the <javac> task, for which see its documentation in the Apache Ant manual. Please use nbusers@netbeans.org if you need more help.
sasbeb: you will never see replies to comments on bugs unless you add yourself to CC.
It's not real apparent how to fix this. Is it well documented? It's too bad there's no way to edit netbeans.conf inside of NB, then require a restart. I'd like to re-open it because it makes the product seem inconsistent.
I don't know anything about documentation. An entry could be made on the NB Wiki giving tips. But I think the release notes already describe how to increase your memory settings.
Sure, I know how to increase memory settings for NetBeans in the netbeans.conf file, but the problem is that it isn't overly obvious that you have to edit it to get rid of the OutOfMemoryError when you compile some java projects. I would have thought that it would have been in the additional compiler options...
Thanks... That worked (modifying the netbeans.conf) BTW... someone pointed me to: >> Bryan, >> >> I experimented quite a bit (!) after you were telling the thing below. >> The setting of the heap meory had worked for me before and so I had to >> figure out what it is and I finally found it and it appears to be a bug >> in Netbeans: ""-J-Xmx512m" option not accepted when using default Java >> Platform" (http://www.netbeans.org/issues/show_bug.cgi?id=68724): >> >> "I created a new project "abc" which uses the Java Platform "JDK 1.5 >> (Default)" for which I have set the "Additional Compiler Options" to >> "-J-Xmx1024m" and I get the message below when I try to compile. >> >> Created dir: C:\Dokumente und Einstellungen\holger\abc\build\classes >> Compiling 1 source file to C:\Dokumente und >> Einstellungen\holger\abc\build\classes >> javac: invalid flag: -J-Xmx1024m >> >> Now I created a new Java Platform "Java HotSpot(TM) Client VM >> 1.5.0_05-b05" (which is actually the same as the default one) and set >> the the project Java Platform to this one. Now I start the compile >> action and the compilation works fine." >> Holger Which way is more "correct"?
Either work, but you may not wish to use a non-default Java platform on your project, as it introduces an Ant property which must be set during a headless build - which can be an advantage in some cases but may seem overhead for some projects. As I said, you can also use build.compiler=extJavac.