You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Rajesh Kartha (JIRA)" <de...@db.apache.org> on 2005/11/03 01:08:55 UTC

[jira] Created: (DERBY-676) OutOfMemoryError in Network Server while performing operations using one of the two Statement objects created from a Connection object

OutOfMemoryError in Network Server while performing operations using one of the two Statement objects created from a Connection object
--------------------------------------------------------------------------------------------------------------------------------------

         Key: DERBY-676
         URL: http://issues.apache.org/jira/browse/DERBY-676
     Project: Derby
        Type: Bug
  Components: Network Server  
    Versions: 10.0.2.1, 10.1.1.0, 10.2.0.0, 10.1.1.1    
 Environment: Windows 2000
    Reporter: Rajesh Kartha


The NetworkServer throws an OutOfMemoryError  if there exists two Statement objects from a Connection object, but only one of them is being actively used
for insert/select operations.  I noticed 100% CPU usage and the memory usage of Network Server JVM steadily growing,  so suspect a memory leak.

The attached test reproduces it.  With the default setting of maz heap size the Exception ocurs in about 12-15 mins during the 'select' operation. By setting  the max heap size  -Xmx for  the Network Server JVM  to a smaller value the error happnes much earlier.

The test is very simple and uses plain Statement objects, which get closed after every insert/select. I tried the same test in the Embedded mode and did not see any errors.

-- 
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


[jira] Commented: (DERBY-676) OutOfMemoryError in Network Server while performing operations using one of the two Statement objects created from a Connection object

Posted by "Bryan Pendleton (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-676?page=comments#action_12356674 ] 

Bryan Pendleton commented on DERBY-676:
---------------------------------------

Perhaps I'm not understanding your program very well, but it seems like you are creating a statement in JdbcTask.executeQuery, but I don't see where you close that statement. So it seems like each time you call executeQuery, you are leaking a Statement object.

> OutOfMemoryError in Network Server while performing operations using one of the two Statement objects created from a Connection object
> --------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-676
>          URL: http://issues.apache.org/jira/browse/DERBY-676
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Versions: 10.0.2.1, 10.1.1.0, 10.2.0.0, 10.1.1.1
>  Environment: Windows 2000
>     Reporter: Rajesh Kartha
>  Attachments: JdbcTask.java, ReproTest.java
>
> The NetworkServer throws an OutOfMemoryError  if there exists two Statement objects from a Connection object, but only one of them is being actively used
> for insert/select operations.  I noticed 100% CPU usage and the memory usage of Network Server JVM steadily growing,  so suspect a memory leak.
> The attached test reproduces it.  With the default setting of maz heap size the Exception ocurs in about 12-15 mins during the 'select' operation. By setting  the max heap size  -Xmx for  the Network Server JVM  to a smaller value the error happnes much earlier.
> The test is very simple and uses plain Statement objects, which get closed after every insert/select. I tried the same test in the Embedded mode and did not see any errors.

-- 
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


[jira] Commented: (DERBY-676) OutOfMemoryError in Network Server while performing operations using one of the two Statement objects created from a Connection object

Posted by "Rajesh Kartha (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-676?page=comments#action_12356717 ] 

Rajesh Kartha commented on DERBY-676:
-------------------------------------

I agree that the repro script is not at all a good example of JDBC programming. I came across this as a user error, hence tried to mimic that scenario into a simple reproduceable one. Sure does end up in Statement leaks,  guess this issue is similar to DERBY-210 then.

With the right JDBC programming practices, I am  positive no one will see this leak happening.


> OutOfMemoryError in Network Server while performing operations using one of the two Statement objects created from a Connection object
> --------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-676
>          URL: http://issues.apache.org/jira/browse/DERBY-676
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Versions: 10.2.0.0, 10.1.1.1, 10.1.1.0, 10.0.2.1
>  Environment: Windows 2000
>     Reporter: Rajesh Kartha
>  Attachments: JdbcTask.java, ReproTest.java
>
> The NetworkServer throws an OutOfMemoryError  if there exists two Statement objects from a Connection object, but only one of them is being actively used
> for insert/select operations.  I noticed 100% CPU usage and the memory usage of Network Server JVM steadily growing,  so suspect a memory leak.
> The attached test reproduces it.  With the default setting of maz heap size the Exception ocurs in about 12-15 mins during the 'select' operation. By setting  the max heap size  -Xmx for  the Network Server JVM  to a smaller value the error happnes much earlier.
> The test is very simple and uses plain Statement objects, which get closed after every insert/select. I tried the same test in the Embedded mode and did not see any errors.

-- 
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


[jira] Updated: (DERBY-676) OutOfMemoryError in Network Server while performing operations using one of the two Statement objects created from a Connection object

Posted by "Rajesh Kartha (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-676?page=all ]

Rajesh Kartha updated DERBY-676:
--------------------------------

    Attachment: JdbcTask.java
                ReproTest.java

Repro attached

> OutOfMemoryError in Network Server while performing operations using one of the two Statement objects created from a Connection object
> --------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-676
>          URL: http://issues.apache.org/jira/browse/DERBY-676
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Versions: 10.0.2.1, 10.1.1.0, 10.2.0.0, 10.1.1.1
>  Environment: Windows 2000
>     Reporter: Rajesh Kartha
>  Attachments: JdbcTask.java, ReproTest.java
>
> The NetworkServer throws an OutOfMemoryError  if there exists two Statement objects from a Connection object, but only one of them is being actively used
> for insert/select operations.  I noticed 100% CPU usage and the memory usage of Network Server JVM steadily growing,  so suspect a memory leak.
> The attached test reproduces it.  With the default setting of maz heap size the Exception ocurs in about 12-15 mins during the 'select' operation. By setting  the max heap size  -Xmx for  the Network Server JVM  to a smaller value the error happnes much earlier.
> The test is very simple and uses plain Statement objects, which get closed after every insert/select. I tried the same test in the Embedded mode and did not see any errors.

-- 
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


[jira] Resolved: (DERBY-676) OutOfMemoryError in Network Server while performing operations using one of the two Statement objects created from a Connection object

Posted by "Rajesh Kartha (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-676?page=all ]
     
Rajesh Kartha resolved DERBY-676:
---------------------------------

    Resolution: Duplicate

Duplicate of DERBY-210

> OutOfMemoryError in Network Server while performing operations using one of the two Statement objects created from a Connection object
> --------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-676
>          URL: http://issues.apache.org/jira/browse/DERBY-676
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Versions: 10.0.2.1, 10.1.1.0, 10.2.0.0, 10.1.1.1
>  Environment: Windows 2000
>     Reporter: Rajesh Kartha
>  Attachments: JdbcTask.java, ReproTest.java
>
> The NetworkServer throws an OutOfMemoryError  if there exists two Statement objects from a Connection object, but only one of them is being actively used
> for insert/select operations.  I noticed 100% CPU usage and the memory usage of Network Server JVM steadily growing,  so suspect a memory leak.
> The attached test reproduces it.  With the default setting of maz heap size the Exception ocurs in about 12-15 mins during the 'select' operation. By setting  the max heap size  -Xmx for  the Network Server JVM  to a smaller value the error happnes much earlier.
> The test is very simple and uses plain Statement objects, which get closed after every insert/select. I tried the same test in the Embedded mode and did not see any errors.

-- 
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