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 "Manish Khettry (JIRA)" <de...@db.apache.org> on 2006/02/02 20:01:03 UTC

[jira] Created: (DERBY-912) OutOfMemory error on continuous execution of SQL statement

OutOfMemory error on continuous execution of SQL statement
----------------------------------------------------------

         Key: DERBY-912
         URL: http://issues.apache.org/jira/browse/DERBY-912
     Project: Derby
        Type: Sub-task
    Versions: 10.0.2.0    
 Environment: cygwin, jdk 1.4
    Reporter: Manish Khettry


After fixing the original memory leak, I still run into problems on repeated execution of a sql statement. Take the sample program in the bug and run it with a small heap size (4m). After around 80-90K executions an outofmemory error is thrown. I took snapshots of the heap while the program was running but couldn't find anything obviously wrong. 

-- 
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] Assigned: (DERBY-912) OutOfMemory error on continuous execution of SQL statement

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

Knut Anders Hatlen reassigned DERBY-912:
----------------------------------------

    Assignee: Knut Anders Hatlen

> OutOfMemory error on continuous execution of SQL statement
> ----------------------------------------------------------
>
>                 Key: DERBY-912
>                 URL: http://issues.apache.org/jira/browse/DERBY-912
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Store
>    Affects Versions: 10.0.2.0
>         Environment: cygwin, jdk 1.4
>            Reporter: Manish Khettry
>         Assigned To: Knut Anders Hatlen
>
> After fixing the original memory leak, I still run into problems on repeated execution of a sql statement. Take the sample program in the bug and run it with a small heap size (4m). After around 80-90K executions an outofmemory error is thrown. I took snapshots of the heap while the program was running but couldn't find anything obviously wrong. 

-- 
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-912) OutOfMemory error on continuous execution of SQL statement

Posted by "Manish Khettry (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-912?page=comments#action_12367238 ] 

Manish Khettry commented on DERBY-912:
--------------------------------------

Yes, it is from the original test program. BTW, I added a conn.commit() to the original program-- so it basically looks like this:

while (true)
{
  ps = conn.prepareStatement(sql);
  rs = ps.executeQuery();
  // read from rs.
  conn.commit();
  // close rs, ps
}

and it still runs out of memory. Shouldn't doing a commit create a new transaction?

> OutOfMemory error on continuous execution of SQL statement
> ----------------------------------------------------------
>
>          Key: DERBY-912
>          URL: http://issues.apache.org/jira/browse/DERBY-912
>      Project: Derby
>         Type: Sub-task
>   Components: Store
>     Versions: 10.0.2.0
>  Environment: cygwin, jdk 1.4
>     Reporter: Manish Khettry

>
> After fixing the original memory leak, I still run into problems on repeated execution of a sql statement. Take the sample program in the bug and run it with a small heap size (4m). After around 80-90K executions an outofmemory error is thrown. I took snapshots of the heap while the program was running but couldn't find anything obviously wrong. 

-- 
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] Closed: (DERBY-912) OutOfMemory error on continuous execution of SQL statement

Posted by "Dyre Tjeldvoll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dyre Tjeldvoll closed DERBY-912.
--------------------------------


> OutOfMemory error on continuous execution of SQL statement
> ----------------------------------------------------------
>
>                 Key: DERBY-912
>                 URL: https://issues.apache.org/jira/browse/DERBY-912
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Store
>    Affects Versions: 10.0.2.0
>         Environment: cygwin, jdk 1.4
>            Reporter: Manish Khettry
>            Assignee: Knut Anders Hatlen
>             Fix For: 10.2.2.0, 10.3.1.4
>
>         Attachments: derby-912-v2.diff, derby-912.diff
>
>
> After fixing the original memory leak, I still run into problems on repeated execution of a sql statement. Take the sample program in the bug and run it with a small heap size (4m). After around 80-90K executions an outofmemory error is thrown. I took snapshots of the heap while the program was running but couldn't find anything obviously wrong. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-912) OutOfMemory error on continuous execution of SQL statement

Posted by "Manish Khettry (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-912?page=comments#action_12366875 ] 

Manish Khettry commented on DERBY-912:
--------------------------------------

It looks like elements from the sorts vector in RAMTransaction are never removed. dropSort merely nulls out the element. If you repeatedly open/execute/close a query that uses a sorter you will leak one reference every iteration. 

> OutOfMemory error on continuous execution of SQL statement
> ----------------------------------------------------------
>
>          Key: DERBY-912
>          URL: http://issues.apache.org/jira/browse/DERBY-912
>      Project: Derby
>         Type: Sub-task
>     Versions: 10.0.2.0
>  Environment: cygwin, jdk 1.4
>     Reporter: Manish Khettry

>
> After fixing the original memory leak, I still run into problems on repeated execution of a sql statement. Take the sample program in the bug and run it with a small heap size (4m). After around 80-90K executions an outofmemory error is thrown. I took snapshots of the heap while the program was running but couldn't find anything obviously wrong. 

-- 
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-912) OutOfMemory error on continuous execution of SQL statement

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

Mike Matrigali updated DERBY-912:
---------------------------------

    Component: Store

> OutOfMemory error on continuous execution of SQL statement
> ----------------------------------------------------------
>
>          Key: DERBY-912
>          URL: http://issues.apache.org/jira/browse/DERBY-912
>      Project: Derby
>         Type: Sub-task
>   Components: Store
>     Versions: 10.0.2.0
>  Environment: cygwin, jdk 1.4
>     Reporter: Manish Khettry

>
> After fixing the original memory leak, I still run into problems on repeated execution of a sql statement. Take the sample program in the bug and run it with a small heap size (4m). After around 80-90K executions an outofmemory error is thrown. I took snapshots of the heap while the program was running but couldn't find anything obviously wrong. 

-- 
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-912) OutOfMemory error on continuous execution of SQL statement

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-912?page=comments#action_12443644 ] 
            
Knut Anders Hatlen commented on DERBY-912:
------------------------------------------

The problem seems to be that RAMTransaction.sorts is only cleared when the connection is closed, not when the transaction is committed. RAMTransaction.commit() calls closeControllers() with closeHeldControllers=false, so sorts.removeAllElements() is not called on commit.

> OutOfMemory error on continuous execution of SQL statement
> ----------------------------------------------------------
>
>                 Key: DERBY-912
>                 URL: http://issues.apache.org/jira/browse/DERBY-912
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Store
>    Affects Versions: 10.0.2.0
>         Environment: cygwin, jdk 1.4
>            Reporter: Manish Khettry
>
> After fixing the original memory leak, I still run into problems on repeated execution of a sql statement. Take the sample program in the bug and run it with a small heap size (4m). After around 80-90K executions an outofmemory error is thrown. I took snapshots of the heap while the program was running but couldn't find anything obviously wrong. 

-- 
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-912) OutOfMemory error on continuous execution of SQL statement

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-912?page=comments#action_12443651 ] 
            
Knut Anders Hatlen commented on DERBY-912:
------------------------------------------

One simple solution is to remove all trailing null elements from the sorts vector on commit. That should leave the held controllers open and not interfere with the sort ids. While it does not solve the general case (a held controller may prevent space reclaimation at the start of the vector), it does solve the most common cases. With that change, the test program completed without running out of memory (-Xmx10M).

> OutOfMemory error on continuous execution of SQL statement
> ----------------------------------------------------------
>
>                 Key: DERBY-912
>                 URL: http://issues.apache.org/jira/browse/DERBY-912
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Store
>    Affects Versions: 10.0.2.0
>         Environment: cygwin, jdk 1.4
>            Reporter: Manish Khettry
>
> After fixing the original memory leak, I still run into problems on repeated execution of a sql statement. Take the sample program in the bug and run it with a small heap size (4m). After around 80-90K executions an outofmemory error is thrown. I took snapshots of the heap while the program was running but couldn't find anything obviously wrong. 

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