Bug 55175 - Eclipse does not remove the "java.lang.OutOfMemoryError" and re-evaluate all the java packages after restart with more memory
Summary: Eclipse does not remove the "java.lang.OutOfMemoryError" and re-evaluate all ...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: Sun HP-UX
: P3 normal (vote)
Target Milestone: 3.0 M8   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-17 16:59 EST by Brian So CLA
Modified: 2004-03-24 07:04 EST (History)
2 users (show)

See Also:


Attachments
Eclipse workbench view with approx. java packages imported (28.47 KB, image/jpeg)
2004-03-17 17:16 EST, Brian So CLA
no flags Details
Eclipse workbench view after imported approx. 80 packages (30.31 KB, image/jpeg)
2004-03-17 17:20 EST, Brian So CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian So CLA 2004-03-17 16:59:38 EST
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.
Comment 1 Brian So CLA 2004-03-17 17:16:47 EST
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.
Comment 2 Brian So CLA 2004-03-17 17:20:37 EST
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.
Comment 3 Dorian Birsan CLA 2004-03-17 17:44:49 EST
Brian, you may want to run eclipse with a larger heap size (-vmargs -Xmx324m)

Moving bug over to JDT.
Comment 4 Brian So CLA 2004-03-18 09:27:49 EST
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".
Comment 5 Olivier Thomann CLA 2004-03-19 11:17:19 EST
"-vmargs -Xms256 -Xm256m" are invalid vm options.
Use "-vmargs -Xms256M -Xmx256M".
Comment 6 Olivier Thomann CLA 2004-03-21 12:35:17 EST
Is it working for you with the right vm args?
Comment 7 Brian So CLA 2004-03-22 08:59:14 EST
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.
Comment 8 Philipe Mulet CLA 2004-03-24 07:04:48 EST
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).