Bug 33972 - [ErrorHandling] Helping users with OutOfMemoryError
Summary: [ErrorHandling] Helping users with OutOfMemoryError
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted, investigate
: 12224 22026 45413 47879 72022 79879 79985 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-03-06 10:21 EST by DJ Houghton CLA
Modified: 2019-11-14 03:48 EST (History)
18 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2003-03-06 10:21:12 EST
Part of the effort to improve the out-of-box experience for Eclipse users.

A lot of users on the newgroups and mailing lists have problems with 
OutOfMemory errors and the common recommendation is for them to increase the 
Java heap size via a command-line argument. We would like to be able to tell 
the user that a problem occurred and to perform this action.

Unfortuanately this command-line arg is dependant on VM so we don't know the 
exact syntax. In the UI I believe that we catch OutOfMemory errors and present 
a dialog to the user. If we could add something like "An OutOfMemoryError 
occurred. Try increasing your Java heap size and restarting." to this message, 
then this would help the user.

Some of the things which we should consider in coming up with the right message:
- we ran out of memory
- they are able to try the operation again
- they may want to adjust their heap size
- how to do this is dependant on their VM
Comment 1 Nick Edgar CLA 2003-03-21 16:23:46 EST
McQ thinks we should punt the user (with warning dialog first) since an 
OutOfMemoryError can cause things to be in an unreliable state.
Anything can happen after this, including loss of data.

We'll investigate how to handle this better for 2.2.
Comment 2 Mike Wilson CLA 2003-03-24 10:13:24 EST
The thing to keep in mind is that, if we are going to punt the user (and I *do* believe that's our only reasonable choice), then we need to ensure that they can do reasonable work in the default memory allocation, at least during the initial "kicking the tires" phase of trying Eclipse. Asking them to increase the memory allocation is reasonable once they are doing serious work. [out of box]
Comment 3 Nick Edgar CLA 2003-09-08 10:33:30 EDT
See the discussion in bug 42291 re polling Runtime.getRuntime().freeMemory().
Should do something like this for R3.0.
Comment 4 John Arthorne CLA 2003-10-23 16:56:14 EDT
If something is done about this you should sweep to close duplicates.  At least
12224, 22026, and 30807 look like duplicates. I think a message in the out of
memory dialog suggesting that the user increase the java heap would go along way
to helping new users cope with it.
Comment 5 John Arthorne CLA 2003-10-23 16:56:36 EDT
*** Bug 45413 has been marked as a duplicate of this bug. ***
Comment 6 Ralf Hauser CLA 2003-10-28 03:04:47 EST
is https://bugs.eclipse.org/bugs/show_bug.cgi?id=23633 a duplicate?
Comment 7 Carolyn MacLeod CLA 2003-12-02 12:28:27 EST
*** Bug 47879 has been marked as a duplicate of this bug. ***
Comment 8 Nick Edgar CLA 2004-04-16 14:19:25 EDT
*** Bug 12224 has been marked as a duplicate of this bug. ***
Comment 9 Nick Edgar CLA 2004-04-16 14:20:07 EDT
*** Bug 22026 has been marked as a duplicate of this bug. ***
Comment 10 Debbie Wilson CLA 2004-05-17 10:48:29 EDT
Bug 30807 provides us with a fix for this problem.  Now, we get a meaningful 
and helpful message when people run out of memory.  There are however, a few 
places in the UI code where an OutOfMemoryError can be caught and not dealt 
with properly.  Note that an OutOf MemoryError can be caught as Throwable, 
Error, or VirtualMachineError.  The following areas should be checked in 
detail before this bug is marked fixed:

EventLoopProgressMonitor - runEventLoop
ExternalEditor - openWithUserDefinedProgram (2x)
FileDocumentProvider - SafeChange/run
IDEExceptionHandler - openQuestionDialog (this one is okay)
KeySequence - getInstance
KeyStroke - getInstance
ModalContext - ModalContextThread/run and runInCurrentThread
PluginAction - createDelegate
Window - runEventLoop
Workbench - runEventLoop (this one is okay)
WorkbenchAdvisor - eventLoopException
Comment 11 Debbie Wilson CLA 2004-05-17 11:09:34 EDT
Running through the classes/methods I listed in the previous comment will not 
be complete for M9.
Comment 12 Debbie Wilson CLA 2004-05-17 13:34:24 EDT
Some of the above references are fine.  The following are the only ones left 
to check:

KeySequence - getInstance
KeyStroke - getInstance
ModalContext - ModalContextThread/run and runInCurrentThread
PluginAction - createDelegate
Window - runEventLoop
WorkbenchAdvisor - eventLoopException
Comment 13 Michael Van Meekeren CLA 2004-05-21 14:01:15 EDT
deb can we declare success here?
Comment 14 Debbie Wilson CLA 2004-05-25 09:41:47 EDT
Not until the 6 areas in comment 12 have been addressed.  Reassigning to 
relevant component.
Comment 15 Michael Van Meekeren CLA 2004-06-03 11:10:24 EDT
defering the rest of this fix till after R3.0
Comment 16 Michael Van Meekeren CLA 2006-04-21 13:59:35 EDT
Moving Dougs bugs
Comment 17 Wieant CLA 2006-08-18 10:36:12 EDT
Hi,

We seem to have run into a case of a ModalContext (see comment #12 item 3) in
which an OOME is not handled yet with a user message. The case concerning is
a wizard dialog in which the finishing runnable causes an out-of-memory error.
This error is caught, and a message is logged, however no UI message is shown,
instead the wizard dialog appears again just like before the Finish button had
been pressed. First instinct is to press the Finish button again, but generally
that just repeats the OOME loop.

Is this issue still under investigation, I might be able to catch the OOME in
the runnable itselve, but I think a generic solution would be preferred?

Regards,
  Wieant
Comment 18 Szymon Brandys CLA 2007-06-22 14:59:49 EDT
*** Bug 79985 has been marked as a duplicate of this bug. ***
Comment 19 Szymon Brandys CLA 2007-06-22 15:19:29 EDT
*** Bug 79879 has been marked as a duplicate of this bug. ***
Comment 20 Szymon Brandys CLA 2007-06-22 16:08:20 EDT
*** Bug 72022 has been marked as a duplicate of this bug. ***
Comment 21 Jacek Pospychala CLA 2009-07-07 09:59:08 EDT
I don't see it mentioned here, so will post just to let you know. IDEA prompts a dialog to increase the Heap and Perm memory. See blog post http://jlaskowski.blogspot.com/2009/05/automatyczna-aktualizacja-i.html (sorry it's in Polish, but screenshots are self-describing)
Comment 22 Lars Vogel CLA 2019-11-14 03:48:23 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.