Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 12224 - [Error Handling] Out of memory conditions
Summary: [Error Handling] Out of memory conditions
Status: RESOLVED DUPLICATE of bug 33972
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux-Motif
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 12391 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-03-25 11:34 EST by Ian Petersen CLA
Modified: 2004-04-16 14:19 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Petersen CLA 2002-03-25 11:34:05 EST
Build: 20020321

OS: Redhat Linux 7.2 with Motif


Description:
I'm running some benchmarks to compare typing in the plain text editor to typing
in the Java editor.  I simulate typing by getting a reference to the StyledText
widget in the editor and then calling StyledText.notifyListeners(Event) with a
key-down event.  In Linux, the Java editor case runs to completion (the first
255,000 characters of org.eclipse.swt.custom.StyledText.java) but the plain text
editor case fails.  I can't find a stack dump, or even a virtual machine core
dump.  When it fails, the screen flashes black, and then shows me the login
screen.  When I log in again, it's as if I had just powered the machine on. 
There is no indication that the benchmark had been running.

I think the problem might have something to do with the auto-indentation.  In
both the Java editor and the text editor, the indentation slowly gets bigger and
bigger because I haven't stripped the indentation from the source file.  The
difference is that, in the Java editor, typing a '}' resets the indentation a
bit.  The text editor doesn't do that, though, so the StyledText has to scroll
further and further to the right (9,000+ columns).  I'm wondering if the number
of columns just gets too big for the StyledText to handle.

The same benchmark also caused a problem on Windows that I am trying to repeat
right now.  I think the error message that it produced was something like a
duplicate memory allocation error from the VM.  If and when the test bombs on
Windows, I'll add a PR and refer to this one.  I'm also going to try to attach a
zip of my benchmark test case.
Comment 1 Ian Petersen CLA 2002-03-25 12:41:41 EST
I couldn't create the attachment, but I've put the zip in walleye under
outgoing/ian.

The zip file is a snapshot of my workspace.  Hopefully everything necessary is
in it, but here's my setup, just in case:

I've imported all of Eclipse as binary projects, and I have the
org.eclipse.pde.junit plugin installed.  To run the test case, launch
EditTextFileBenchmark with the JUnit Workbench launcher.  EditTextFileBenchmark
is in /org.eclipse.benchmarks/Java Tooling/org.eclipse.benchmarks.jdt
Comment 2 Ian Petersen CLA 2002-03-25 14:07:49 EST
I've discovered that the problem is an OutOfMemoryError.  I'm re-running the
test to find out what character index I reach before causing the error.
Comment 3 Ian Petersen CLA 2002-03-25 15:21:38 EST
The problem is definitely a result of the auto-indent feature.  After typing
141,582 characters, the text widget contained 20,509,104 characters, so the
OutOfMemoryError isn't really a surprise.

Why does the plain text editor auto-indent?
Comment 4 Nick Edgar CLA 2002-03-27 21:58:06 EST
Sounds like a problem with StyledText.
I'm giving this a lower priority since it only occurs under strange 
circumstances.
Comment 5 Lynne Kues CLA 2002-03-28 10:14:35 EST
The StyledText widget does not supply an auto-indent feature.  This is 
something that the JFace Text Editor is doing.  Reassigning to Kai.  As 
indicated, it sounds like the basic JFace Text Editor just shouldn't auto-
indent.
Comment 6 Nick Edgar CLA 2002-03-28 10:18:01 EST
However, if the StyledText crashes when the line is too long, then this should 
be fixed too.
Comment 7 Nick Edgar CLA 2002-03-28 11:39:03 EST
Sorry, I skipped the fact that it was an OutOfMemoryError.  
I thought it was some other exception in a call to the OS from StyledText.
StyledText clearly can do nothing in this case.
Comment 8 Kai-Uwe Maetzel CLA 2002-06-05 09:35:39 EDT
Removing auto indent does not help as it just pushes the boundaries of the 
problem. Eclipse does not have any OutOfMemory story outside of operations. 
Depending on the position in the calling chain, we just crash. Normally, you 
don't see the crash, as it first happens inside operations such as build.

No action for 2.0. 
Comment 9 Veronika Irvine CLA 2002-09-10 10:28:16 EDT
Kai, are you still the right person to own this PR?  Should it be moved to 
Platform Text?
Comment 10 Erich Gamma CLA 2002-09-10 16:56:51 EDT
Reopening bug for consideration.
Fatal errors are logged and reported by the platform UI, but as Kai has raised 
the solution of handling such conditions can involve other components as well.
Comment 11 DJ Houghton CLA 2002-09-27 09:46:19 EDT
*** Bug 12391 has been marked as a duplicate of this bug. ***
Comment 12 Andre John Mas CLA 2004-04-16 14:14:16 EDT
this bug is marked 2002 and is still open - is it still an issue?
Comment 13 Nick Edgar CLA 2004-04-16 14:19:24 EDT
This is still an open issue, being tracked as bug 33972.

*** This bug has been marked as a duplicate of 33972 ***