Bug 178370

Summary: OutOfMemoryError not handled gracefully
Product: [Technology] STEM Reporter: Daniel Ford <webdaford>
Component: InternalAssignee: Stefan Edlund <sedlund>
Status: ASSIGNED --- QA Contact: Daniel Ford <webdaford>
Severity: normal    
Priority: P4 Keywords: polish
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.