Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 34719 - Hierarchy causes OutOfMemoryError during full-rebuild
Summary: Hierarchy causes OutOfMemoryError during full-rebuild
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 2.1 RC3   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-11 15:13 EST by Rafael Chaves CLA
Modified: 2003-03-13 12:15 EST (History)
1 user (show)

See Also:


Attachments
log file (20.67 KB, application/x-zip-compressed)
2003-03-11 15:14 EST, Rafael Chaves CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Chaves CLA 2003-03-11 15:13:21 EST
Build: RC2
VM: Sun JDK 1.4.1_01 or _02 (didn't happen with IBM JRE 1.3.1_sr2)

Changing the default JRE (triggers a full-build) while a class tree appears on 
the Hierarchy view causes a OutOfMemoryError.

Steps to reproduce:
1 - in a new workspace, import all plug-ins as binary projects
2 - open IResourceChangeListener in the Hierarchy view
3 - open Java->installed JREs preference page, add a second JRE (if you have 
only one), and make it the default one (or just select a different configured 
JRE to be default). 
4 - Confirming the changes will show a dialog: "The JRE settings have changed. 
A full build will be required...". Say "yes", you want a full build.
5 - the process will take minutes (what is weird, because we only have binary 
projects), and will finish with an error: "Creating hierarchy failed. Check log 
for details".

I will add the log (1.2Mb of text, containing lots of deeeeep stack traces).
Comment 1 Rafael Chaves CLA 2003-03-11 15:14:18 EST
Created attachment 4012 [details]
log file
Comment 2 Erich Gamma CLA 2003-03-12 10:20:36 EST
This one needs investigation. Moving to JDT-Core but we will also look at it 
here.
Comment 3 Olivier Thomann CLA 2003-03-12 10:42:20 EST
What are your settings for the heap size? Do you use -vmargs -X256M or another
value on your command line?
Comment 4 Rafael Chaves CLA 2003-03-12 11:35:36 EST
Yeap, -Xmx256m did the trick. The default maximum stack size for Sun JDK 1.4.1 
is 64 MB (don't know what is the default for IBM's JREs).

Anyway, are the deep recursive calls (> 50 levels) in TypeHierarchyViewPart's 
runnable what you expect to happen in such scenario (the bug does not happen if 
the Hierarchy does not have to refreshed)? If so, feel free to close it as 
user's fault.





Comment 5 Jerome Lanneluc CLA 2003-03-12 11:55:09 EST
Erich, any comment on the deep recursive call on TypeHierarchyViewPart?
Comment 6 Erich Gamma CLA 2003-03-12 12:27:01 EST
Cannot explain the stack trace - this needs further investigation. Adopting bug.
Comment 7 Martin Aeschlimann CLA 2003-03-13 12:06:09 EST
The reason for the queued up asych execs is that the launcher calls the JRE 
initializers for each project, but does not batch this. Each call to the 
initializer results in a delta, and each delta result is a asynch exec posted 
by the type hierarchy. When the JRE page invokes the build in the forked mode, 
the async execs are executed in the middle of the build.

Fixed in the type hierachy by adding a new flag that prevents the posting of a 
runnable if there is still an update request pending.
Filed bug 34919 against debug to batch the calls to the initializers.

> 20030313

Erich, can you review? The modfied file is TypeHierarchyViewPart.java
The same release also fixes bug 34068 (return statement after isVisible check)
Comment 8 Erich Gamma CLA 2003-03-13 12:15:11 EST
reviewed