Make Derby engine robust in case of OutOfMemoryError exceptions
---------------------------------------------------------------

         Key: DERBY-443
         URL: http://issues.apache.org/jira/browse/DERBY-443
     Project: Derby
        Type: Task
    Reporter: Daniel John Debrunner
    Priority: Minor


Derby currently treats an OutOfMemoryError as a virtual machine exception, 
terminal failure and shuts down.
However in many cases Derby could (possibly) recover gracefully by just 
disallowing the requested operation.
Examples are
   - reject  a connection request
   - throw an exception on a new compilation (e.g. prepareStatement or 
executeQuery)
   - not increase the size of  a cache
    - don't boot the database

I think the only case where recovery is not possible is an exception during a 
rollback, in this case the database needs to be shutdown and recovery will 
correctly handle the situation.

In addition a system wide facility could be added that  is called upon low 
memory and tries to reduce memory usage by Derby, e.g. reduce the size of 
various caches. An initial version of this could be very simple, just calling 
System.gc().

I was thinking this could be the high level task, and sub tasks could be added 
for individual pieces of work, e.g. connection handling, statement handling 
etc. as people wanted to address items.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to