cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Shaw (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-3244) JDBC CassandraConnection may lead to memory leak when used in a pool
Date Fri, 23 Sep 2011 03:43:26 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-3244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13113139#comment-13113139
] 

Rick Shaw commented on CASSANDRA-3244:
--------------------------------------

It keeps them on a list because {{Statement}} structures are associated with the creating
{{Connection}}. Closing the {{Connection}} closes all {{Statement}} items. {{Statement}} 
structures are re-usable; you _usually_ only open one or maybe a few.  But it does keep track
of all you create. I don't see how that implies a memory leak?

> JDBC CassandraConnection may lead to memory leak when used in a pool
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-3244
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3244
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Drivers
>    Affects Versions: 1.0.0
>            Reporter: Patricio Echague
>            Priority: Minor
>
> I may be wrong here but I noticed that the implementations of CassandraConnection#createStatement()
and CassandraConnection#prepareStatement() keep(cache) the created Statement/PrepareStatement
internally in a List.
> They list is freed up only during CassandraConnection.close() which makes me think that,
if the connection object is used in a pool implementation, it will lead to a memory leak as
it will hold every single statement that is used to interact with the DB until the connection
gets closed. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message