You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Alexei Scherbakov (JIRA)" <ji...@apache.org> on 2017/01/20 15:11:27 UTC

[jira] [Commented] (IGNITE-4578) SQL: Statement cache can cause memory leak

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

Alexei Scherbakov commented on IGNITE-4578:
-------------------------------------------

Andrew,

Statement cache is cleared by background thread.

{noformat}
if (t.getState() == Thread.State.TERMINATED
                || cur - entry.getValue().lastUsage() > STATEMENT_CACHE_THREAD_USAGE_TIMEOUT)
                it.remove();
{noformat}

Why do you think we'll get a memory leak ?

> SQL: Statement cache can cause memory leak
> ------------------------------------------
>
>                 Key: IGNITE-4578
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4578
>             Project: Ignite
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.8
>            Reporter: Andrew Mashenkov
>
> We have prepared statement cache in IgniteH2Indexing declared as Map<Thread, StatementCache>.
> This can cause memory leak if threads will die unexpetedly.
> We should declare StatementCache as ThreadLocal field. This along with separate thread pool for SQL queries (see IGNITE-4105) should resolve the issue..



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)