{"action":"closed","issue":{"url":"https://api.github.com/repos/Qihoo360/pika/issues/200","repository_url":"https://api.github.com/repos/Qihoo360/pika","labels_url":"https://api.github.com/repos/Qihoo360/pika/issues/200/labels{/name}","comments_url":"https://api.github.com/repos/Qihoo360/pika/issues/200/comments","events_url":"https://api.github.com/repos/Qihoo360/pika/issues/200/events","html_url":"https://github.com/Qihoo360/pika/issues/200","id":266525202,"number":200,"title":"Codis 集群中的 Pika 迁移数据会导致内存占用不释放","user":{"login":"imneov","id":31612033,"avatar_url":"https://avatars3.githubusercontent.com/u/31612033?v=4","gravatar_id":"","url":"https://api.github.com/users/imneov","html_url":"https://github.com/imneov","followers_url":"https://api.github.com/users/imneov/followers","following_url":"https://api.github.com/users/imneov/following{/other_user}","gists_url":"https://api.github.com/users/imneov/gists{/gist_id}","starred_url":"https://api.github.com/users/imneov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imneov/subscriptions","organizations_url":"https://api.github.com/users/imneov/orgs","repos_url":"https://api.github.com/users/imneov/repos","events_url":"https://api.github.com/users/imneov/events{/privacy}","received_events_url":"https://api.github.com/users/imneov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-10-18T14:56:52Z","updated_at":"2017-11-02T08:21:28Z","closed_at":"2017-11-02T08:21:28Z","author_association":"CONTRIBUTOR","body":"4核16G，codis3.2，pika2.2.6\r\n\r\n当从pika服务器上迁移数据至另外一台pika时，迁出数据的那一台pika内存会暴涨，直至被系统杀掉。\r\n\r\n停止迁移后内存也不会释放。\r\n\r\n附：执行完 client kill all 以及 tcmalloc free 后的一些输出\r\n\r\n```#info\r\n# Server\r\npika_version:2.2.6\r\npika_git_sha:e646201f53c5584294bdb2dece7b073f0d0e69b2\r\npika_build_compile_date: Oct 18 2017\r\nos:Linux 3.10.0-514.26.2.el7.x86_64 x86_64\r\narch_bits:64\r\nprocess_id:20761\r\ntcp_port:9221\r\nthread_num:24\r\nsync_thread_num:6\r\nuptime_in_seconds:14593\r\nuptime_in_days:1\r\nconfig_file:codis-vip/config/pika.conf\r\n\r\n# Data\r\ndb_size:3647584020\r\ndb_size_human:3478M\r\ncompression:snappy\r\nused_memory:391508416\r\nused_memory_human:373M\r\ndb_memtable_usage:331723072\r\ndb_tablereader_usage:59785344\r\n\r\n# Log\r\nlog_size:1012468563\r\nlog_size_human:965M\r\nsafety_purge:write2file50\r\nexpire_logs_days:7\r\nexpire_logs_nums:10\r\nbinlog_offset:60 42589143\r\n\r\n# Clients\r\nconnected_clients:2\r\n\r\n# Stats\r\ntotal_connections_received:172\r\ninstantaneous_ops_per_sec:1\r\ntotal_commands_processed:1764926\r\nis_bgsaving:No, , 0\r\nis_slots_reloading:No, , 0\r\nis_scaning_keyspace:No\r\nis_compact:Key\r\ncompact_cron:\r\ncompact_interval:\r\n\r\n# Replication(MASTER)\r\nrole:master\r\nconnected_slaves:0\r\n\r\n# Keyspace\r\n# Time:1970-01-01 08:00:00\r\nkv keys:0\r\nhash keys:0\r\nlist keys:0\r\nzset keys:0\r\nset keys:0\r\n```\r\n\r\n```#tcmalloc stats\r\n 1) \"------------------------------------------------\"\r\n 2) \"MALLOC:    13868634344 (13226.2 MiB) Bytes in use by application\"\r\n 3) \"MALLOC: +     14131200 (   13.5 MiB) Bytes in page heap freelist\"\r\n 4) \"MALLOC: +     66687496 (   63.6 MiB) Bytes in central cache freelist\"\r\n 5) \"MALLOC: +      1573376 (    1.5 MiB) Bytes in transfer cache freelist\"\r\n 6) \"MALLOC: +     22657808 (   21.6 MiB) Bytes in thread cache freelists\"\r\n 7) \"MALLOC: +     69599232 (   66.4 MiB) Bytes in malloc metadata\"\r\n 8) \"MALLOC:   ------------\"\r\n 9) \"MALLOC: =  14043283456 (13392.7 MiB) Actual memory used (physical + swap)\"\r\n10) \"MALLOC: +   3409305600 ( 3251.4 MiB) Bytes released to OS (aka unmapped)\"\r\n11) \"MALLOC:   ------------\"\r\n12) \"MALLOC: =  17452589056 (16644.1 MiB) Virtual address space used\"\r\n13) \"MALLOC:\"\r\n14) \"MALLOC:        1045863              Spans in use\"\r\n15) \"MALLOC:             37              Thread heaps in use\"\r\n16) \"MALLOC:           8192              Tcmalloc page size\"\r\n17) \"------------------------------------------------\"\r\n18) \"Call ReleaseFreeMemory() to release freelist memory to the OS (via madvise()).\"\r\n19) \"Bytes released to the\"\r\n```\r\n\r\n```#top\r\nop - 22:56:06 up 6 days,  9:30,  2 users,  load average: 0.96, 0.92, 0.88\r\nTasks: 107 total,   1 running, 106 sleeping,   0 stopped,   0 zombie\r\n%Cpu(s): 16.3 us,  6.5 sy,  0.0 ni, 74.6 id,  2.6 wa,  0.0 hi,  0.0 si,  0.0 st\r\nKiB Mem : 16267956 total,   427064 free, 13810972 used,  2029920 buff/cache\r\nKiB Swap:        0 total,        0 free,        0 used.  2156264 avail Mem\r\n\r\n  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND\r\n20761 codis     20   0 16.571g 0.013t   3948 S  90.0 83.3 303:02.56 pika\r\n   12 root      rt   0       0      0      0 S   0.3  0.0   0:00.73 migration/1\r\n 1596 root      20   0  136968   6464   1568 S   0.3  0.0  17:36.42 AliYunDun\r\n 5978 root      20   0    1540    176     96 S   0.3  0.0   3:31.48 aliyun-service\r\n 98\r\n```\r\n\r\n  \r\n"}}
{"actor":{"display_login":"imneov"}}