Community
Participate
Working Groups
I was attempted to import 100 java packages (each package with approx. 20 classes and 20 members) on to Eclipse. I did it by importing approx. 20 packages at a time. All classes would have an error after import: "The declared package does not match the expected package ...". All the imported packages had an "X" symbol at the left bottom corner of the package symbol indicated that "this java element causes an error" (see attachement imported_first_30_packages.bmp). After I have imported approx. 80 packages, I caused the "java.lang.OutOfMemoryError". Most of the "X" symbols had disappeared and I had less errors. The "Internal compiler error java.lang.OutOfMemoryError" was displayed (see attachment outOfMemory.bmp). I then exited Eclipse and started Eclipse again with extra memory allocated (256M). Since Eclipse had more memory now, it should re-evaluate all the java packages. Unfortunately the "Internal compiler error java.lang.OutOfMemoryError" was still displayed and most of the the "X" symbols had not come back. After I deleted some folders, the re-evaluated got triggered and the errors came back. Here are the steps to follow in order to regenerate this scenario: 1. Install Eclipse 3.0M7 on HP_UX 11.00. and launch Eclipse. 2. Create 100 test packages using the "createpackages.jar" file (I can provide this file to create the packages for testing if necessary). 3. Create a Java project named “stress”. Switch to Java Perspective if the current Perspective is something else. 4. Import the 100 packages into “stress” approx. 20 packages at a time. All the packages had errors because the package name is different from what declared in all the classes. The "The declared package does not match the expected package ..." errors can be see seen in the problem view. 5. After imported approx. 80 packages, the "java.lang.OutOfMemoryError" will be displayed on the Unix window where you started Eclipse. 6. Close Eclipse by selecting “File -> Exit” from the main menu. 7. Restart Eclipse with 256M memory allocated. Expected behaviour: Eclipse has more memory now, so it should re-evaluate all the java packages. The "Internal compiler error java.lang.OutOfMemoryError" should disappeared. All the java packages errors should comes up with an "X" symbol at the left bottom corner of the package symbol. Actual behaviour: The "Internal compiler error java.lang.OutOfMemoryError" remains. Most of the the "X" symbols have not come back. Elipse did not re-evaluate all the java packages until some packages are deleted. Please note that that you can recreate the problem with less packages/classes if you decrease the memory when you start Eclipse.
Created attachment 8644 [details] Eclipse workbench view with approx. java packages imported I could not attach a bmp file (size too large) so I attach a jpeg version instead.
Created attachment 8645 [details] Eclipse workbench view after imported approx. 80 packages I could not attach a bmp file (size too big) so I attach a jpeg version instead.
Brian, you may want to run eclipse with a larger heap size (-vmargs -Xmx324m) Moving bug over to JDT.
When I used "-vmargs -Xms256 -Xm256m" and I could import all 100 java packages with no issue (it is slow though). However I think when I restart Eclipse with enough memory/heap size, Eclipse should reevaluate its content (e.g. the java packages) and remove the "java.lang.OutOfMemoryError".
"-vmargs -Xms256 -Xm256m" are invalid vm options. Use "-vmargs -Xms256M -Xmx256M".
Is it working for you with the right vm args?
Yes, it is working. I was using the correct options but I had a typo when I filled in the bug report. I could import 100 packages from scratch. Thanks. But if I started with not enough memory and then restarted eclipse with enough memory, the "Internal compiler error java.lang.OutOfMemoryError" stayed until I removed some packages. I have not tried to see if it will go away when I add some packages instead.
You need to cause a rebuild to have this problem go away. What happened is that an internal failure in the compiler (could be bug in compiler or VM crash as you experienced with Out of Memory). We log these so that users have some feedback of something wrong having occurred during compile. But you need to force a recompile to get rid of these internal errors (hopefully these should never occur).