Bug 28913 - [typing] Shift right allocates too much memory WAS: Eclipse corrupts data when it runs out of heap
Summary: [typing] Shift right allocates too much memory WAS: Eclipse corrupts data whe...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2002-12-30 10:12 EST by Oyvind Harboe CLA
Modified: 2004-05-17 06:17 EDT (History)
0 users

See Also:


Attachments
Sample numbers to paste (36.41 KB, text/plain)
2002-12-30 10:12 EST, Oyvind Harboe CLA
no flags Details
Java file to reproduce problem (413 bytes, text/plain)
2002-12-30 10:14 EST, Oyvind Harboe CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oyvind Harboe CLA 2002-12-30 10:12:11 EST
1. Load the attached M3.java file.
2. paste the sample numbers into the array(from attached t.txt)
3. Select all the sample numbers *only*
4. Press tab.
5. Crash(various requesters are shown).


From log:

!SESSION des 30, 2002 16:32:18.723 ---------------------------------------------
java.version=1.4.1_01
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=no_NO
Command-line arguments: -os win32 -ws win32 -arch x86 -install file:C:/m4/
!ENTRY org.eclipse.ui 4 4 des 30, 2002 16:32:18.723
!MESSAGE Unhandled exception caught in event loop.
!ENTRY org.eclipse.ui 4 0 des 30, 2002 16:32:18.733
!MESSAGE java.lang.OutOfMemoryError
!STACK 0
java.lang.OutOfMemoryError
!ENTRY org.eclipse.ui 4 4 des 30, 2002 16:32:25.252
!MESSAGE Save All Failed
!ENTRY org.eclipse.ui 2 0 des 30, 2002 16:32:25.262
!MESSAGE Save All Failed
!STACK 0
java.lang.OutOfMemoryError
Comment 1 Oyvind Harboe CLA 2002-12-30 10:12:59 EST
Created attachment 2875 [details]
Sample numbers to paste
Comment 2 Oyvind Harboe CLA 2002-12-30 10:14:36 EST
Created attachment 2876 [details]
Java file to reproduce problem
Comment 3 Dirk Baeumer CLA 2002-12-31 09:51:41 EST
To solve the problem increase the heap size of the Java VM. See 
http://dev.eclipse.org:8080/help/content/help:/org.eclipse.platform.doc.user/tas
ks/running_eclipse.htm for details how to do so. 
Comment 4 Oyvind Harboe CLA 2002-12-31 10:21:46 EST
I respectfully claim that this issue is not resolved.

1. There is evidence in my bugreport that Eclipse will cause data corruption if 
it runs out of heap.

2. The default heap size(or how Eclipse uses it) must be wrong. I only tried to 
indent a very modest amount of text(~1000 lines). 

3. The way the user discovers that he needs to increase heap size, is that the 
application crashes(possibly causing data corruption). Not very smooth.

4. How much heap and how it uses it should be dealt with by the application, 
not the user. IMHO.

5. Although, IMHO, the user should never have to worry about heap size, it 
would be nice if the next time Eclipse launches it proposes to increase the 
heap size.

Øyvind
Comment 5 Dirk Baeumer CLA 2003-02-03 07:20:36 EST
How the heap is managed and how big the heap is depends on the VM, so Eclipse 
can't in general adjust the Heap-Size of a VM.

But I like the idea that the workbench opens an information dialog telling the 
user that he might increase the heap size if an OutOfMemory Exception is caught.
Open separate bug for this.

I retested the scenario with the latest integration build I20030129 with the 
standard heap size (JDK Sun 1.4.1) and it still produces an OME. Moving to text 
if this points to some "unnecessary" memory consuption.

Filed separate bug 30807 for the automatic adaption of the heap size request. 
Comment 6 Dani Megert CLA 2003-07-16 08:33:17 EDT
Adapted summary.
Investigate when we do a performance pass.
Comment 7 Dani Megert CLA 2004-05-17 06:17:17 EDT
Verified that we don't leak memory here.
See bug 33972 which covers general improvement of OOME handling.