Community
Participate
Working Groups
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.
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
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.
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?
Sounds like a problem with StyledText. I'm giving this a lower priority since it only occurs under strange circumstances.
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.
However, if the StyledText crashes when the line is too long, then this should be fixed too.
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.
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.
Kai, are you still the right person to own this PR? Should it be moved to Platform Text?
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.
*** Bug 12391 has been marked as a duplicate of this bug. ***
this bug is marked 2002 and is still open - is it still an issue?
This is still an open issue, being tracked as bug 33972. *** This bug has been marked as a duplicate of 33972 ***