Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 268969 - dev-util/netbeans-6.7_beta-r4 fails to build: not enough memory
Summary: dev-util/netbeans-6.7_beta-r4 fails to build: not enough memory
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-07 20:00 UTC by Martin von Gagern
Modified: 2009-10-12 21:20 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge --info,5.20 KB, text/plain)
2009-05-07 20:03 UTC, Martin von Gagern
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2009-05-07 20:00:03 UTC
Latest netbeans repeatedly failed to build for me. Latest error message was this:

projectized-common.compile:
    [mkdir] Created dir: /var/tmp/portage/dev-util/netbeans-6.7_beta-r4/work/mobility.end2end/build/classes
 [nb-javac] JSR 269 not found, loading from /var/tmp/portage/dev-util/netbeans-6.7_beta-r4/work/apisupport.harness/external/openjdk-javac-6-b12.jar
 [nb-javac] Compiling 75 source files to /var/tmp/portage/dev-util/netbeans-6.7_beta-r4/work/mobility.end2end/build/classes
  [nbmerge] Failed to build target: all-mobility.end2end

BUILD FAILED
/var/tmp/portage/dev-util/netbeans-6.7_beta-r4/work/nbbuild/build.xml:664: The following error occurred while executing this line:
/var/tmp/portage/dev-util/netbeans-6.7_beta-r4/work/nbbuild/build.xml:659: The following error occurred while executing this line:
/var/tmp/portage/dev-util/netbeans-6.7_beta-r4/work/nbbuild/build.xml:706: The following error occurred while executing this line:
/var/tmp/portage/dev-util/netbeans-6.7_beta-r4/work/nbbuild/templates/common.xml:150: Error starting compiler: java.lang.reflect.InvocationTargetException

Total time: 90 minutes 45 seconds
 * 
 * ERROR: dev-util/netbeans-6.7_beta-r4 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 4415:  Called eant '-Dstop.when.broken.modules=true' '-Dpermit.jdk6.builds=true' '-Dbuild.compiler.deprecation=false' '-Dnb.clusters.list=nb.cluster.platform,nb.cluster.apisupport,nb.cluster.cnd,nb.cluster.dlight,nb.cluster.enterprise,nb.cluster.ergonomics,nb.cluster.groovy,nb.cluster.harness,nb.cluster.ide,nb.cluster.identity,nb.cluster.java,nb.cluster.mobility,nb.cluster.nb,nb.cluster.php,nb.cluster.profiler,nb.cluster.ruby,nb.cluster.webcommon,nb.cluster.websvccommon' '-f' 'nbbuild/build.xml' 'build-nozip' 'build-javadoc'
 *             environment, line  974:  Called die
 * The specific snippet of code:
 *       ant ${antflags} "${@}" || die "eant failed"
 *  The die message:
 *   eant failed
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/log/portage/dev-util:netbeans-6.7_beta-r4:20090506-191010.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-util/netbeans-6.7_beta-r4/temp/environment'.
 * 
!!! When you file a bug report, please include the following information:
GENTOO_VM=sun-jdk-1.5  CLASSPATH="" JAVA_HOME="/opt/sun-jdk-1.5.0.18"
JAVACFLAGS="-source 1.5 -target 1.5" COMPILER="javac"
and of course, the output of emerge --info

# emerge -pv netbeans
[ebuild  NS   ] dev-util/netbeans-6.7_beta-r4 [5.5.1-r1, 6.5-r4] USE="doc -debug" LINGUAS="de -cs -es -fr -it -ja -ko -nl -pl -pt_BR -ru -sq -tr -zh_CN -zh_TW" NETBEANS_MODULES="apisupport cnd dlight enterprise ergonomics groovy harness ide identity java mobility nb php profiler ruby webcommon websvccommon"

I tried to reproduce the issue using the following command:
# GENTOO_VM=sun-jdk-1.5 ANT_TASKS="ant-nodeps,ant-trax" ant <args as above>
I got a different error this time:

 [nb-javac] Compiling 116 source files to /var/tmp/portage/dev-util/netbeans-6.7_beta-r4/work/o.mozilla.rhino.patched/build/classes
   [repeat] 
   [repeat] 
   [repeat] The system is out of resources.
   [repeat] Consult the following stack trace for details.
   [repeat] java.lang.OutOfMemoryError: Java heap space
   [repeat]     at com.sun.tools.javac.jvm.ClassReader.sigToType(ClassReader.java:608)
   [repeat]     at com.sun.tools.javac.jvm.ClassReader.sigToType(ClassReader.java:524)
   [repeat]     at com.sun.tools.javac.jvm.ClassReader.readType(ClassReader.java:460)
...
   [repeat]     at com.sun.tools.javac.comp.Resolve.loadClass(Resolve.java:857)
  [nbmerge] Failed to build target: all-o.mozilla.rhino.patched

Looking at previous build logs, I got even an even different error message in the past:

 [nb-javac] Compiling 6 source files to /var/tmp/portage/dev-util/netbeans-6.7_beta-r4/work/mobility.j2meunit/build/classes
   [repeat] Note: org.netbeans.modules.mobility.j2meunit.J2MEUnitProjectLookupProvider to be registered as a org.netbeans.spi.mobility.project.ProjectLookupProvider
   [repeat] error: Exception thrown while constructing Processor object: PermGen space
  [nbmerge] Failed to build target: all-mobility.j2meunit

So it might well be that insufficient memory is at the cause of all these issues, only that in the first message above, the reflection catches the error, so it won't get reported propery.

It might be that setting ANT_OPTS=-Xmx512m or similar in the ebuild will help. As the build takes quite a long time on my system, I won't try this today.
Comment 1 Martin von Gagern 2009-05-07 20:03:54 UTC
Created attachment 190640 [details]
emerge --info
Comment 2 Miroslav Šulc gentoo-dev 2009-05-07 23:54:55 UTC
This is from the ebuild: ANT_OPTS="-Xmx1g -Djava.awt.headless=true"

So the build might need even more memory when building 'doc'. If you really do not need javadoc documentation to netbeans code then you better turn 'doc' USE flag off. This way netbeans is built "pretty fast".
Comment 3 Martin von Gagern 2009-05-08 13:49:22 UTC
(In reply to comment #2)
> So the build might need even more memory when building 'doc'.

Yes: build successfully with -Xmx1536m in 120 minutes user time.

> If you really do
> not need javadoc documentation to netbeans code then you better turn 'doc' USE
> flag off. This way netbeans is built "pretty fast".

I guess I'll do so in the future, once I've verified it's really memory what's causing these problems. Thanks!

I guess there are a lot of developers out there who want documentation for most stuff they install "just in case", and who therefore have the doc USE flag on. So if netbeans docs are exceptionally resource-consuming, maybe some kind of warning or a differently named FLAG would be in order. I don't know.
Comment 4 Miroslav Šulc gentoo-dev 2009-05-08 16:54:23 UTC
Martin, thank you for finding the right value and testing the build. I put -Xmx1536m in ANT_OPTS in case 'doc' USE flag is used, committed in -r4.

I also put info about the 'doc' USE flag to http://en.gentoo-wiki.com/wiki/Netbeans so ppl can find out how to avoid long builds if they do not need the source documentation.
Comment 5 Martin von Gagern 2009-10-12 14:22:56 UTC
dev-util/netbeans-6.8_alpha2 fails due to lack of memory even without USE=doc. This on a system with around 3GB of free RAM+Swap.
The failed target was all-mobility.jsr172

I guess there should be a binary package for netbeans, or some adjustment to the build system, as this kind of build process really isn't feasible.
Comment 6 Miroslav Šulc gentoo-dev 2009-10-12 18:15:44 UTC
i had no issue building netbeans-6.8_alpha2 using the ebuild so i have no idea why memory was sufficient on my system but is not sufficient on your system. any idea what could be the cause? i use:

$ java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
Comment 7 Martin von Gagern 2009-10-12 20:27:49 UTC
(In reply to comment #6)
> any idea what could be the cause? i use:

Current system VM needn't be the build VM. From the build log:

!!! When you file a bug report, please include the following information:
GENTOO_VM=sun-jdk-1.5  CLASSPATH="" JAVA_HOME="/opt/sun-jdk-1.5.0.21"
JAVACFLAGS="-source 1.5 -target 1.5" COMPILER="javac"
and of course, the output of emerge --info

Did you have NETBEANS_MODULES=mobility resp. USE=netbeans_modules_mobility? Disabling that single module made my build work. All other modules were and still are enabled.

I guess my system, 32bit ~x86, might have something to do with it as well.
Comment 8 Miroslav Šulc gentoo-dev 2009-10-12 21:20:18 UTC
that was just to show what jdk was used to build netbeans.

here is my netbeans config:

dev-util/netbeans-6.8_alpha2  USE="debug -doc" LINGUAS="cs -ar -de -es -fr -gl -id -it -ja -ko -nl -pl -pt_BR -ru -sq -sv -tr -zh_CN -zh_TW" NETBEANS_MODULES="apisupport cnd dlight enterprise ergonomics groovy harness ide identity java mobility nb php profiler ruby websvccommon"