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

Jay Zhuang commented on CASSANDRA-13929:
----------------------------------------

I tested the change with {{LongStreamingTest}}, seems no impact with/without 
{{Recycler}}:
{noformat}
With Recycler
    [junit] ERROR [main] 2018-02-22 16:57:56,189 SubstituteLogger.java:250 - 
Writer finished after 22 seconds....
    [junit] ERROR [main] 2018-02-22 16:58:16,480 SubstituteLogger.java:250 - 
Finished Streaming in 20.29 seconds: 23.66 Mb/sec
    [junit] ERROR [main] 2018-02-22 16:58:35,921 SubstituteLogger.java:250 - 
Finished Streaming in 19.44 seconds: 24.69 Mb/sec
    [junit] ERROR [main] 2018-02-22 16:59:25,719 SubstituteLogger.java:250 - 
Finished Compacting in 49.80 seconds: 19.44 Mb/sec

No Recycler
    [junit] ERROR [main] 2018-02-22 16:50:48,255 SubstituteLogger.java:250 - 
Writer finished after 22 seconds....
    [junit] ERROR [main] 2018-02-22 16:51:08,209 SubstituteLogger.java:250 - 
Finished Streaming in 19.95 seconds: 24.06 Mb/sec
    [junit] ERROR [main] 2018-02-22 16:51:27,624 SubstituteLogger.java:250 - 
Finished Streaming in 19.41 seconds: 24.72 Mb/sec
    [junit] ERROR [main] 2018-02-22 16:52:16,900 SubstituteLogger.java:250 - 
Finished Compacting in 49.28 seconds: 19.48 Mb/sec
{noformat}

Here is the patch, please review:
| Branch | uTest |
| [13929-3.11|https://github.com/cooldoger/cassandra/tree/13929-3.11] | 
[!https://circleci.com/gh/cooldoger/cassandra/tree/13929-3.11.svg?style=svg!|https://circleci.com/gh/cooldoger/cassandra/tree/13929-3.11]
 |
| [13929-trunk|https://github.com/cooldoger/cassandra/tree/13929-trunk] | 
[!https://circleci.com/gh/cooldoger/cassandra/tree/13929-trunk.svg?style=svg!|https://circleci.com/gh/cooldoger/cassandra/tree/13929-trunk]
 |

> BTree$Builder / io.netty.util.Recycler$Stack leaking memory
> -----------------------------------------------------------
>
>                 Key: CASSANDRA-13929
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13929
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Thomas Steinmaurer
>            Assignee: Jay Zhuang
>            Priority: Major
>             Fix For: 3.11.x
>
>         Attachments: cassandra_3.11.0_min_memory_utilization.jpg, 
> cassandra_3.11.1_NORECYCLE_memory_utilization.jpg, 
> cassandra_3.11.1_mat_dominator_classes.png, 
> cassandra_3.11.1_mat_dominator_classes_FIXED.png, 
> cassandra_3.11.1_snapshot_heaputilization.png, 
> cassandra_3.11.1_vs_3.11.2recyclernullingpatch.png, 
> dtest_example_80_request.png, dtest_example_80_request_fix.png, 
> dtest_example_heap.png, memleak_heapdump_recyclerstack.png
>
>
> Different to CASSANDRA-13754, there seems to be another memory leak in 
> 3.11.0+ in BTree$Builder / io.netty.util.Recycler$Stack.
> * heap utilization increase after upgrading to 3.11.0 => 
> cassandra_3.11.0_min_memory_utilization.jpg
> * No difference after upgrading to 3.11.1 (snapshot build) => 
> cassandra_3.11.1_snapshot_heaputilization.png; thus most likely after fixing 
> CASSANDRA-13754, more visible now
> * MAT shows io.netty.util.Recycler$Stack as top contributing class => 
> cassandra_3.11.1_mat_dominator_classes.png
> * With -Xmx8G (CMS) and our load pattern, we have to do a rolling restart 
> after ~ 72 hours
> Verified the following fix, namely explicitly unreferencing the 
> _recycleHandle_ member (making it non-final). In 
> _org.apache.cassandra.utils.btree.BTree.Builder.recycle()_
> {code}
>         public void recycle()
>         {
>             if (recycleHandle != null)
>             {
>                 this.cleanup();
>                 builderRecycler.recycle(this, recycleHandle);
>                 recycleHandle = null; // ADDED
>             }
>         }
> {code}
> Patched a single node in our loadtest cluster with this change and after ~ 10 
> hours uptime, no sign of the previously offending class in MAT anymore => 
> cassandra_3.11.1_mat_dominator_classes_FIXED.png
> Can' say if this has any other side effects etc., but I doubt.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to