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] Updated: (DERBY-444) Handle OutOfMemoryError exceptions when creating a new embedded connection
Date Fri, 03 Mar 2006 03:56:43 GMT
     [ http://issues.apache.org/jira/browse/DERBY-444?page=all ]

Daniel John Debrunner updated DERBY-444:
----------------------------------------

    Attachment: derby444_draft_v1.txt

Draft patch of the direction I'm working on.

The program/test  memory/ConnectionHandling.java (added under this issue) creates about 19,000
connections
in a JVM limited to 64Mb before failing due to an OutOfMemoryError. The test then goes on
to try to open 500
more connections (while holding the previous 19,000+ open)  to see what happens.

With the existing code basically a mess happens, the initial OutOfMemoryError I think closes
the database
and then each of the 500 connection opens is a (slow) boot attempt with limited memory. About
95 out of 500 pass,
but I believe all the existing connections are closed since the database was closed underneath
them. The
test does have logic to count how many of its existing open connections have become closed
, but with the
existing code an OutOfMemoryError is hit and no reporting takes place.

With the patch, roughly the same number  (19,000+)  of connections are successfully opened,
but the most of
the subsequent failures due to lack of memory receive a SQLException with a 08004 SQL state.
These exceptions
do not shut down the database and the 19,000 connections remain open, and can be closed with
no further exceptions.
About 495 of the 500 requests once memory is full receive a 08004 SQLException, and about
5 recieve a direct OutOfMemoryError.
These dirrect OutOfMemoryErrors occur above Derby, in the DriverManager class due to object
allocation there. Thus the OOME has
no effect on Derby.

Thus a summary is:
 Existing code:
       19,000+ connections in 64Mb, once limit is hit all are implicitly closed and a handful
of future requests succeed
       but any OOME shuts the database down again. System does not degrade well.

  Patch
       19,000+ connections in 64Mb, once limit is hit some stability is acheieved, no more
connection requests succeed.
        System behaves well.

Next comment will describe this draft patch

> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message