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.

Bug 225536 - Can no longer build my project - it runs out of resources
Summary: Can no longer build my project - it runs out of resources
Status: RESOLVED INVALID
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 7.3
Hardware: Macintosh Mac OS X
: P2 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-30 14:04 UTC by twolf2919
Modified: 2013-01-31 09:59 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (44.92 KB, text/plain)
2013-01-30 14:04 UTC, twolf2919
Details

Note You need to log in before you can comment on or make changes to this bug.
Description twolf2919 2013-01-30 14:04:00 UTC
I just installed 7.3rc1 and can no longer build my project.  The first problem I encountered was that RC1 didn't import my Java 6 platform.  So my Java-6 based project didn't compile.  Once I added the Java 6 platform back in, I ran into the out-of-resources issue mentioned in the summary.  The error is shown below:

ant -f /Users/twolf/NetBeansProjects/trunk compile
init:
Deleting: /private/tmp/netbeans/build/built-jar.properties
deps-jar:
Updating property file: /private/tmp/netbeans/build/built-jar.properties
Compiling 4289 source files to /private/tmp/netbeans/build/classes


The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError: Java heap space
	at com.sun.tools.javac.util.Position$LineMapImpl.build(Position.java:139)
	at com.sun.tools.javac.util.Position.makeLineMap(Position.java:63)
	at com.sun.tools.javac.parser.Scanner.getLineMap(Scanner.java:1105)
	at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:512)
	at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:550)
	at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:804)
	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
	at com.sun.tools.javac.main.Main.compile(Main.java:353)
	at com.sun.tools.javac.main.Main.compile(Main.java:279)
	at com.sun.tools.javac.main.Main.compile(Main.java:270)
	at com.sun.tools.javac.Main.compile(Main.java:69)
	at com.sun.tools.javac.Main.main(Main.java:54)
/Users/twolf/NetBeansProjects/trunk/nbproject/build-impl.xml:952: The following error occurred while executing this line:
/Users/twolf/NetBeansProjects/trunk/nbproject/build-impl.xml:299: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 26 seconds)

I vaguely remember during earlier days of NB that we had to give extra compiler options to give javac more heap, but this has not been an issue for a long time - is it back?

So this issue is actually two rolled into one:
1) NB 7.3 doesn't import Java 6 platform
2) It can no longer build my project for lack of heap space in the compiler.


Product Version = NetBeans IDE 7.3 RC1 (Build 201301240957)
Operating System = Mac OS X version 10.8.2 running on x86_64
Java; VM; Vendor = 1.6.0_37
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.12-b01-434
Comment 1 twolf2919 2013-01-30 14:04:03 UTC
Created attachment 130835 [details]
IDE log
Comment 2 Milos Kleint 2013-01-30 16:10:00 UTC
is the same problem occurring when running outside of the IDE on the cmd line? what are your ANT_OPTS env var settings?

what project type(s) are your projects?
Comment 3 twolf2919 2013-01-30 19:03:19 UTC
Milos, 
1) I get the same error outside the IDE
2) I don't use ant on my system outside of NB, so ANT_OPTS isn't set int the environment.
3) I only have one project - and it's J2SE.

To do (1), I set JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/ and then ran 'ant jar' in the NB project directory.

When I switch back to NB 7.2.1 and do a build, everything works!?  But it is the same project directory!  So this leads me to believe that there's some property somewhere in NB 7.2.1 (but not 7.3).

I have no clue what the problem might be, but I did noticed that  in my 7.2.1 and 7.3rc1 netbeans.conf, I had netbeans_jdkhome set as follows:
     netbeans_jdkhome="System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home"
Note that it's missing a "/" at the beginning of the path!

When I added the "/" and started NB 7.3rc1, the compile worked!

So, perhaps NB 7.3rc1 and 7.2.1 default to a different JDK when the one given via the netbeans_jdkhome is invalid?

Anyway, I guess you can close the bug as it appears to be - at least partially - user error.  The fact that it didn't import my JDK 6 platform (problem #2) is still a mystery, but maybe that was also due to the ill-formatted netbeans_jdkhome variable.  Who knows.
Comment 4 Milos Kleint 2013-01-31 09:59:41 UTC
one additional difference between 7.3 and 7.2 could be the version of ant (however I'm not positive we actually upgraded in 7.3 timeframe.

but since the problem occurs on cmd line, I would say it's not a problem in netbeans itself. Unless the 7.2 build script differs from the 7.3 build script, which I assume not to be the case.

So the only difference between 7.2 and 7.3+cmdline appears to be the amount of memory allocated to the 7.2 JVM? Maybe sometimes in the past you modifies the 7.2 configuration file to increase the amount of memory?

In any case that's what I would recommend as fix, increase the amount of heap and/or perm gen memory allocated to the IDE. That's fairly simpler than the other option of splitting your project into multiple smaller ones..