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 138880

Summary: NetBeans requires about twice the memory as Eclipse
Product: ide Reporter: gmtschlr <gmtschlr>
Component: PerformanceAssignee: Pavel Flaska <pflaska>
Status: CLOSED WONTFIX    
Severity: blocker    
Priority: P3    
Version: 3.x   
Hardware: All   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:

Description gmtschlr 2008-07-03 00:09:23 UTC
This is more a report than anything else.

Have a project with a large file set (10100 files).  In order to get the project built, I had to set the -Xmx value 
for NetBeans to 1280 megs.  Even then, it took about 15 minutes to build the project.  It took a day or so to figure 
this out, since most of the time, the IDE just steopped responding.  Finally, it did give an out of memory exception, 
and I increased the -Xmx value in the config file.

I also tried the same set of files in Eclipse 3.4, and I found that I only had to set its Xmx value to 768 megs in 
order to get it to build the same set of files (and it did it in about half the time (on a somewhat slower machine)).
Comment 1 Pavel Flaska 2009-04-02 13:53:47 UTC
Please, provide more information about your setup. -- Do you use network disks? Are the files located in different directories or in one directory? Did you 
try 6.5?

Comment 2 Pavel Flaska 2009-05-12 15:38:31 UTC
Reporter didn't provide any additional data, moreover, the code changed a lot, closing as WORKSFORME.
Comment 3 gmtschlr 2009-06-10 00:55:46 UTC
Supplied such additional information as I could to pflaska directly by email relative to the 6.5 version.  After 
receiving the closure notice with an indication that it probably works on 6.7, I tried again on the 6.7 RC2 version, 
with mostly the same results.  (The only difference is that the compilation stoped accumulating time after 43 minutes 
of CPU time.  The Eclipse complation takes less than 10 minutes and 768MB) That is, despite the referenced numerous 
changes, the problem persists.  I can supply the source files, but I am VERY reluctant to, since they are highly 
proprietary.
Comment 4 Pavel Flaska 2009-06-10 15:07:58 UTC
Gene:
"I am using a local disk.
The files are in a directory tree, with about a third (~2800 files) in the top level, and the remainder in two directories beneath it, split equally.  Most of the 
program code is in the files in the top directory; the subdirectories contain, respectively, interfaces and some small table objects.   A typical file in the top 
directory would implement one class and would have 500-700 lines."

Comment 5 Pavel Flaska 2009-06-10 15:12:36 UTC
Gene:
"Correction to my previous.  The set of files where there were 2800 files in the top directory will actually compile.   We added some new classes to the 
product, resulting in a file set with about 3400 files in the top directory and each of the sub directories. This is the file set that will not compile in 
netbeans.  (BTW, have not tried this on 6.5, so I do not know if it is still a problem there.)"
I tried the 6.7 RC2 compiler.  There still seems to be a problem (unless there is some sort of tweak I can make somewhere to expand the java heap).


init:
deps-jar:
Compiling 10104 source files to C:\Projects\.......\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.code.Scope$ImportScope.makeEntry(Scope.java:385)
       at com.sun.tools.javac.code.Scope.enter(Scope.java:196)
       at com.sun.tools.javac.code.Scope.enter(Scope.java:183)
       at com.sun.tools.javac.comp.MemberEnter.importAll(MemberEnter.java:132)
       at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:538)
       at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:495)
       at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
       at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:399)
       at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:512)
       at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
       at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
       at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
       at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
       at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758)
       at com.sun.tools.javac.comp.Enter.complete(Enter.java:451)
       at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
       at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
       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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
       at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1065)
       at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:882)
       at org.netbeans.modules.java.source.ant.JavacTask.execute(JavacTask.java:120)
       at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
       at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
C:\Projects\ARM42L\nbproject\build-impl.xml:377: The following error occurred while executing this line:
C:\Projects\ARM42L\nbproject\build-impl.xml:186: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 2 minutes 57 seconds)


Comment 6 Pavel Flaska 2009-06-10 15:12:51 UTC
Gene:
"Correction to my previous.  The set of files where there were 2800 files in the top directory will actually compile.   We added some new classes to the 
product, resulting in a file set with about 3400 files in the top directory and each of the sub directories. This is the file set that will not compile in 
netbeans.  (BTW, have not tried this on 6.5, so I do not know if it is still a problem there.)"
I tried the 6.7 RC2 compiler.  There still seems to be a problem (unless there is some sort of tweak I can make somewhere to expand the java heap).


init:
deps-jar:
Compiling 10104 source files to C:\Projects\.......\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.code.Scope$ImportScope.makeEntry(Scope.java:385)
       at com.sun.tools.javac.code.Scope.enter(Scope.java:196)
       at com.sun.tools.javac.code.Scope.enter(Scope.java:183)
       at com.sun.tools.javac.comp.MemberEnter.importAll(MemberEnter.java:132)
       at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:538)
       at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:495)
       at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
       at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:399)
       at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:512)
       at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
       at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
       at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
       at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
       at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758)
       at com.sun.tools.javac.comp.Enter.complete(Enter.java:451)
       at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
       at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
       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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
       at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1065)
       at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:882)
       at org.netbeans.modules.java.source.ant.JavacTask.execute(JavacTask.java:120)
       at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
       at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
C:\Projects\ARM42L\nbproject\build-impl.xml:377: The following error occurred while executing this line:
C:\Projects\ARM42L\nbproject\build-impl.xml:186: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 2 minutes 57 seconds)


Comment 7 Pavel Flaska 2009-06-10 15:19:12 UTC
Removing incomplete keyword.
Comment 8 Pavel Flaska 2009-06-12 11:24:20 UTC
Gene, if you can provide sources and description how to reproduce (if I understood correctly, compilation and scanning takes ages), it would be fine.

There can be many reasons why you get in troubles, e.g.
http://www.netbeans.org/issues/show_bug.cgi?id=42683
http://www.netbeans.org/issues/show_bug.cgi?id=134990

Summary (as I understood from previous discussion):
You have one huge project with many files in packages (details above). The project is J2SE (!?) type and does not have huge set of dependencies on other 
projects.
Comment 9 Pavel Flaska 2009-09-15 10:05:52 UTC
Gene, have you chance to try current dev. builds? There are many improvements. We still do not have reproducible use-case. See also issue #171510 
(OOME).
For the time being, closing as WORKSFORME. Please, reopen, if you are able to reproduce and provide additional data. Thanks.