Bug 178370 - OutOfMemoryError not handled gracefully
Summary: OutOfMemoryError not handled gracefully
Status: ASSIGNED
Alias: None
Product: STEM
Classification: Technology
Component: Internal (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Stefan Edlund CLA
QA Contact: Daniel Ford CLA
URL:
Whiteboard:
Keywords: polish
Depends on:
Blocks:
 
Reported: 2007-03-20 14:28 EDT by Daniel Ford CLA
Modified: 2010-08-16 12:54 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Ford CLA 2007-03-20 14:28:47 EDT
Reproduce by running a sceanrio with the entire world and 512M (or less) for STEM.

An "Internal Error" error message is reported in a dialog box, but the true cause of the problem isn't obvious.  It would probably be better to catch the error itself, report it with an error message that tells the user what to do, and then terminate the simulation cleanly.
Comment 1 John Thomas CLA 2007-05-04 16:24:05 EDT
This is not as easy as it sounds.  
The OutOfMemory can occur in any part of the code, (OSGI, Eclipse code, GUI, or our user code.)  We can probably catch some portion of these by looking a parts of our code where we know that we are going to be requesting a lot of memory and catching OutOfMemory.  But our ability to terminate cleanly is questionable.

Java 1.4, I believe, adds a new call so that one can find out how close we are to running out of memory so perhaps at the start of each cycle, we could verify that we have some percent of free memory (preference) and pause if not enough. That would allow the user to perhaps terminate some views (map, ge, multiple simulations) so that it could then proceed.

 

Comment 2 Daniel Ford CLA 2007-10-17 15:36:50 EDT
This doesn't happen very often, reducing priority.
Comment 3 Daniel Ford CLA 2008-07-17 09:29:16 EDT
Yossi, I'm not sure what to do with this one right now, but it might be related to memory leaks.
Comment 4 James Kaufman CLA 2010-08-16 12:54:53 EDT
This is a feature request (to gracefully show warning). Memory leaks have been fixed since this bug.