Bug 209065 - [index] Frequent OutOfMemory errors self hosting
Summary: [index] Frequent OutOfMemory errors self hosting
Status: RESOLVED DUPLICATE of bug 166223
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-07 12:52 EST by Tod Creasey CLA
Modified: 2007-12-11 07:51 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tod Creasey CLA 2007-11-07 12:52:13 EST
When I self host and a build is requuired I frequently get the following error:

Exception in thread "Java indexing" java.lang.OutOfMemoryError: Java heap space

STEPS
1) Load platform-ui and platform-ui-tests module from HEAD
2) Self host
3) In the self hosted workspace select Import-Existing Plug-ins
4) Select source 
5) Select ide and workbench
6) Hit finish
7) The wizard will finish and a build will kick off. At this point the build
will fail.

Note that I am not running with the -XmX option when this happens. I am trying now with -XmX1024M and have not seen it again
Comment 1 Frederic Fusier CLA 2007-11-07 13:02:52 EST
Did you change the -Xmx value in your eclipse.ini file or use the default one?
Comment 2 Olivier Thomann CLA 2007-11-07 13:03:41 EST
By default the memory is 64M, so no surprise this would fail. -XmX1024M seems a bit too much. Do you really need that much memory to complete the build ?
Comment 3 Frederic Fusier CLA 2007-11-07 13:14:54 EST
(In reply to comment #2)
> By default the memory is 64M, so no surprise this would fail. -XmX1024M seems a
> bit too much. Do you really need that much memory to complete the build ?
> 
Olivier, since bug 166223 was fixed, the launched configuration should use the same -Xmx value than the eclipse default one. That's why I asked Tod whether he changed this value or not. If not, the value is 256M and we should not fail with OOME while indexing.

Note that following comment 0, I didn't get the exception. So, either Tod modified the eclipse default value or I missed something while executing the scenario.
Comment 4 Tod Creasey CLA 2007-11-07 14:02:57 EST
In comment 0 I said 

"Note that I am not running with the -XmX option when this happens. I am trying
now with -XmX1024M and have not seen it again"

And I have not seen it with a large -XmX value. But the 256M default was chosen as it should be suffecient for something as small as help hosting the SDK (my SDK has a heap in the 40M range normally).
Comment 5 Frederic Fusier CLA 2007-11-08 04:09:08 EST
(In reply to comment #4)
> In comment 0 I said 
> 
> "Note that I am not running with the -XmX option when this happens. I am trying
> now with -XmX1024M and have not seen it again"
> 
I saw this line, but for me that means that you didn't set any -Xmx option on your command line while starting an eclipse session. However, you can also change the Java Heap Size of your Eclipse session by changing the value in the eclipse.ini file. As I cannot reproduce the exception, I was asking the question to be 100% sure that your Java Heap Size was the default one (e.g. 256M)

> And I have not seen it with a large -XmX value. But the 256M default was chosen
> as it should be suffecient for something as small as help hosting the SDK (my
> SDK has a heap in the 40M range normally).
> 
It definitely should be enough and as I said, I cannot get the exception when I follow your scenario. So, please first double-check your eclipse.ini file to see if the default is really 256M and second be more precise on the steps of your scenario:
 - what are the exact list of projects you have loaded in your workspace
   (platform-ui and platform-ui-tests are not projects in the repository)?
 - what are the exact list of plugins you import in your self-hosted wksp:
   "ide and workbench" mean only org.eclipse.ui.ide and org.eclipse.ui.workbench   
   or other ones?
Comment 6 Tod Creasey CLA 2007-11-08 10:26:21 EST
I do this without any changes to what is downloaded. 

Here is what is in the default eclipse.ini that I get from the download

-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Xms40m
-Xmx256m




With a fresh 20071107-1300 install and the steps below I get

Exception in thread "Java indexing" java.lang.OutOfMemoryError: Java heap space
	at org.eclipse.jdt.internal.compiler.util.HashtableOfObject.<init>(HashtableOfObject.java:39)
	at org.eclipse.jdt.internal.compiler.util.HashtableOfObject.rehash(HashtableOfObject.java:139)
	at org.eclipse.jdt.internal.compiler.util.HashtableOfObject.put(HashtableOfObject.java:112)
	at org.eclipse.jdt.internal.core.index.DiskIndex.copyQueryResults(DiskIndex.java:349)
	at org.eclipse.jdt.internal.core.index.DiskIndex.mergeWith(DiskIndex.java:522)
	at org.eclipse.jdt.internal.core.index.Index.save(Index.java:181)
	at org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndex(IndexManager.java:583)
	at org.eclipse.jdt.internal.core.search.indexing.AddJarFileToIndex.execute(AddJarFileToIndex.java:205)
	at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:395)
	at java.lang.Thread.run(Thread.java:619)


this pretty much happens every time I self host now so it is easy to reproduce.
Comment 7 Frederic Fusier CLA 2007-11-08 14:12:56 EST
OK, I got it now, after having discovered what "modules" means ;-)
Comment 8 Frederic Fusier CLA 2007-11-09 05:08:39 EST
OK, this is finally a duplicate of bug 166223. I didn't realize at that time, but user still needs to set -Xmx value in the VM arguments of the launch configuration. Bug 166223 fix was only for newly created launch config and only if the corresponding preference is set: see bug 166223 comment 18 for more details...

So, the conclusion is that you need to set the -Xmx VM argument in your launch config. I tried with -Xmx128M and never got the OOME again :-)


*** This bug has been marked as a duplicate of bug 166223 ***
Comment 9 Jerome Lanneluc CLA 2007-12-11 07:51:51 EST
Moving to PDE/UI