db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel John Debrunner (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-444) Handle OutOfMemoryError exceptions when creating a new embedded connection
Date Fri, 03 Mar 2006 04:30:41 GMT
    [ http://issues.apache.org/jira/browse/DERBY-444?page=comments#action_12368650 ] 

Daniel John Debrunner commented on DERBY-444:

The draft patch has three components:

1) Catching OutOfMemoryErrors in the paths where a new embedded connection is obtained. Basically
EmbeddedConnection constructor and within InternalDriver when creating the connection.

2) A new static SQLException with SQLstate 08004 that is thrown when a connection cannot be
obtained due to low memory

3) A new LowMemory class that provides utiltity methods to indicate and check for low memory.
Any area that
can recover from an out of memory situation can create a static instance of this class to
manage its own low
memory threshold. The setLowMemory() is called when an OutOfMemoryError is thrown and records
the current free
memory, that value is then used as future watermark at which point the operation (in this
case opening a connection)
will not be attempted and instead a low memory situation is assumed, and the static exception
Setting the low water mark value needs some more investigation.

Future ideas include having a callback where on a low memory situation, seen by LowMemory.setLowMemory,
callbaclks coudl be invoked to get classes to reduce their memory usage, such as caches.

> Handle OutOfMemoryError exceptions when creating a new embedded connection
> --------------------------------------------------------------------------
>          Key: DERBY-444
>          URL: http://issues.apache.org/jira/browse/DERBY-444
>      Project: Derby
>         Type: Sub-task
>   Components: JDBC
>     Reporter: Daniel John Debrunner
>     Assignee: Daniel John Debrunner
>  Attachments: derby444_draft_v1.txt
> If an OutOfMemoryError is thrown while creating objects for a new embedded connection,
reject the connection request with a SQLException and do not shutdown the system.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message