同样是互为主从的两个tokyotrant进程,数据量和数据条目(基本)相同,但是内存使用却差别很大,却是为何? 是内存碎片还是内存泄露?
4131端口的内存map如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
[root@localhost ~]# cat /proc/10884/maps 00400000-00441000 r-xp 00000000 08:11 27852816 /data1/tokyotyrant/bin/ttserver 00640000-00641000 rw-p 00040000 08:11 27852816 /data1/tokyotyrant/bin/ttserver 119bd000-4047f000 rw-p 119bd000 00:00 0 [heap] 40493000-40494000 ---p 40493000 00:00 0 40494000-40e94000 rw-p 40494000 00:00 0 41446000-41447000 ---p 41446000 00:00 0 41447000-4144a000 rw-p 41447000 00:00 0 41503000-41504000 ---p 41503000 00:00 0 41504000-41f04000 rw-p 41504000 00:00 0 41f04000-41f05000 ---p 41f04000 00:00 0 41f05000-42905000 rw-p 41f05000 00:00 0 42905000-42906000 ---p 42905000 00:00 0 42906000-43306000 rw-p 42906000 00:00 0 43306000-43307000 ---p 43306000 00:00 0 43307000-43d07000 rw-p 43307000 00:00 0 43d07000-43d08000 ---p 43d07000 00:00 0 43d08000-44708000 rw-p 43d08000 00:00 0 44708000-44709000 ---p 44708000 00:00 0 44709000-45109000 rw-p 44709000 00:00 0 45109000-4510a000 ---p 45109000 00:00 0 4510a000-45b0a000 rw-p 4510a000 00:00 0 45b0a000-45b0b000 ---p 45b0a000 00:00 0 45b0b000-4650b000 rw-p 45b0b000 00:00 0 4650b000-4650c000 ---p 4650b000 00:00 0 4650c000-46f0c000 rw-p 4650c000 00:00 0 46f0c000-46f0d000 ---p 46f0c000 00:00 0 46f0d000-4790d000 rw-p 46f0d000 00:00 0 4790d000-4790e000 ---p 4790d000 00:00 0 4790e000-4830e000 rw-p 4790e000 00:00 0 4830e000-4830f000 ---p 4830e000 00:00 0 4830f000-48d0f000 rw-p 4830f000 00:00 0 48d0f000-48d10000 ---p 48d0f000 00:00 0 48d10000-49710000 rw-p 48d10000 00:00 0 49710000-49711000 ---p 49710000 00:00 0 49711000-4a111000 rw-p 49711000 00:00 0 4a111000-4a112000 ---p 4a111000 00:00 0 4a112000-4ab12000 rw-p 4a112000 00:00 0 4ab12000-4ab13000 ---p 4ab12000 00:00 0 4ab13000-4b513000 rw-p 4ab13000 00:00 0 4b513000-4b514000 ---p 4b513000 00:00 0 4b514000-4b517000 rw-p 4b514000 00:00 0 36a6400000-36a641c000 r-xp 00000000 08:01 327990 /lib64/ld-2.5.so 36a661b000-36a661c000 r--p 0001b000 08:01 327990 /lib64/ld-2.5.so 36a661c000-36a661d000 rw-p 0001c000 08:01 327990 /lib64/ld-2.5.so 36a6800000-36a694d000 r-xp 00000000 08:01 327991 /lib64/libc-2.5.so 36a694d000-36a6b4d000 ---p 0014d000 08:01 327991 /lib64/libc-2.5.so 36a6b4d000-36a6b51000 r--p 0014d000 08:01 327991 /lib64/libc-2.5.so 36a6b51000-36a6b52000 rw-p 00151000 08:01 327991 /lib64/libc-2.5.so 36a6b52000-36a6b57000 rw-p 36a6b52000 00:00 0 36a6c00000-36a6c02000 r-xp 00000000 08:01 327992 /lib64/libdl-2.5.so 36a6c02000-36a6e02000 ---p 00002000 08:01 327992 /lib64/libdl-2.5.so 36a6e02000-36a6e03000 r--p 00002000 08:01 327992 /lib64/libdl-2.5.so 36a6e03000-36a6e04000 rw-p 00003000 08:01 327992 /lib64/libdl-2.5.so 36a7000000-36a7082000 r-xp 00000000 08:01 327996 /lib64/libm-2.5.so 36a7082000-36a7281000 ---p 00082000 08:01 327996 /lib64/libm-2.5.so 36a7281000-36a7282000 r--p 00081000 08:01 327996 /lib64/libm-2.5.so 36a7282000-36a7283000 rw-p 00082000 08:01 327996 /lib64/libm-2.5.so 36a7400000-36a7416000 r-xp 00000000 08:01 327682 /lib64/libpthread-2.5.so 36a7416000-36a7615000 ---p 00016000 08:01 327682 /lib64/libpthread-2.5.so 36a7615000-36a7616000 r--p 00015000 08:01 327682 /lib64/libpthread-2.5.so 36a7616000-36a7617000 rw-p 00016000 08:01 327682 /lib64/libpthread-2.5.so 36a7617000-36a761b000 rw-p 36a7617000 00:00 0 36a7c00000-36a7c07000 r-xp 00000000 08:01 327998 /lib64/librt-2.5.so 36a7c07000-36a7e07000 ---p 00007000 08:01 327998 /lib64/librt-2.5.so 36a7e07000-36a7e08000 r--p 00007000 08:01 327998 /lib64/librt-2.5.so 36a7e08000-36a7e09000 rw-p 00008000 08:01 327998 /lib64/librt-2.5.so 36a8c00000-36a8c0f000 r-xp 00000000 08:03 1311050 /usr/lib64/libbz2.so.1.0.3 36a8c0f000-36a8e0e000 ---p 0000f000 08:03 1311050 /usr/lib64/libbz2.so.1.0.3 36a8e0e000-36a8e10000 rw-p 0000e000 08:03 1311050 /usr/lib64/libbz2.so.1.0.3 36a9c00000-36a9c15000 r-xp 00000000 08:01 327882 /lib64/libnsl-2.5.so 36a9c15000-36a9e14000 ---p 00015000 08:01 327882 /lib64/libnsl-2.5.so 36a9e14000-36a9e15000 r--p 00014000 08:01 327882 /lib64/libnsl-2.5.so 36a9e15000-36a9e16000 rw-p 00015000 08:01 327882 /lib64/libnsl-2.5.so 36a9e16000-36a9e18000 rw-p 36a9e16000 00:00 0 36ad800000-36ad811000 r-xp 00000000 08:01 327755 /lib64/libresolv-2.5.so 36ad811000-36ada11000 ---p 00011000 08:01 327755 /lib64/libresolv-2.5.so 36ada11000-36ada12000 r--p 00011000 08:01 327755 /lib64/libresolv-2.5.so 36ada12000-36ada13000 rw-p 00012000 08:01 327755 /lib64/libresolv-2.5.so 36ada13000-36ada15000 rw-p 36ada13000 00:00 0 2aaaaaaab000-2aaad2cab000 rw-p 2aaaaaaab000 00:00 0 2aaad4000000-2aaad8000000 rw-p 2aaad4000000 00:00 0 2aaad8000000-2aaadc000000 rw-p 2aaad8000000 00:00 0 2aaadc000000-2aaaec000000 rw-p 2aaadc000000 00:00 0 2aaaec000000-2aaaf4000000 rw-p 2aaaec000000 00:00 0 2aaaf4000000-2aab00000000 rw-p 2aaaf4000000 00:00 0 2aab00000000-2aab04000000 rw-p 2aab00000000 00:00 0 2aab04000000-2aab0c000000 rw-p 2aab04000000 00:00 0 2aab10000000-2aab20000000 rw-p 2aab10000000 00:00 0 2aab20000000-2aab30000000 rw-p 2aab20000000 00:00 0 2aab30000000-2aab4c000000 rw-p 2aab30000000 00:00 0 2aab4c000000-2aab50000000 rw-p 2aab4c000000 00:00 0 2aab50000000-2aab5c000000 rw-p 2aab50000000 00:00 0 2aab5c000000-2aab6c000000 rw-p 2aab5c000000 00:00 0 2aab70000000-2aab80000000 rw-p 2aab70000000 00:00 0 2aab84000000-2aab98000000 rw-p 2aab84000000 00:00 0 2aab9c000000-2aaba8000000 rw-p 2aab9c000000 00:00 0 2aabac000000-2aabd0000000 rw-p 2aabac000000 00:00 0 2aabd4000000-2aabd6e30000 rw-p 2aabd4000000 00:00 0 2aabd6e30000-2aabd8000000 ---p 2aabd6e30000 00:00 0 2aabdc000000-2aabe0000000 rw-p 2aabdc000000 00:00 0 2afbb2dc2000-2afbb2dc4000 rw-p 2afbb2dc2000 00:00 0 2afbb2dc4000-2afbb2ddb000 r-xp 00000000 08:11 27852808 /data1/tokyotyrant/lib/libtokyotyrant.so.3.24.0 2afbb2ddb000-2afbb2fdb000 ---p 00017000 08:11 27852808 /data1/tokyotyrant/lib/libtokyotyrant.so.3.24.0 2afbb2fdb000-2afbb2fdc000 rw-p 00017000 08:11 27852808 /data1/tokyotyrant/lib/libtokyotyrant.so.3.24.0 2afbb2fdc000-2afbb3064000 r-xp 00000000 08:11 18415627 /data1/tokyocabinet/lib/libtokyocabinet.so.9.10.0 2afbb3064000-2afbb3263000 ---p 00088000 08:11 18415627 /data1/tokyocabinet/lib/libtokyocabinet.so.9.10.0 2afbb3263000-2afbb3265000 rw-p 00087000 08:11 18415627 /data1/tokyocabinet/lib/libtokyocabinet.so.9.10.0 2afbb3276000-2afbb327b000 rw-p 2afbb3276000 00:00 0 7fff4251a000-7fff42531000 rw-p 7ffffffe8000 00:00 0 [stack] ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 [vdso] [root@localhost ~]# |
4141端口的内存map如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
[root@localhost ~]# cat /proc/15022/maps 00400000-00441000 r-xp 00000000 08:11 8781840 /data1/tokyotyrant/bin/ttserver 00640000-00641000 rw-p 00040000 08:11 8781840 /data1/tokyotyrant/bin/ttserver 1e5e4000-3ddbf000 rw-p 1e5e4000 00:00 0 [heap] 40292000-40293000 ---p 40292000 00:00 0 40293000-40c93000 rw-p 40293000 00:00 0 41c65000-41c66000 ---p 41c65000 00:00 0 41c66000-42666000 rw-p 41c66000 00:00 0 42666000-42667000 ---p 42666000 00:00 0 42667000-43067000 rw-p 42667000 00:00 0 43067000-43068000 ---p 43067000 00:00 0 43068000-43a68000 rw-p 43068000 00:00 0 43a68000-43a69000 ---p 43a68000 00:00 0 43a69000-44469000 rw-p 43a69000 00:00 0 44469000-4446a000 ---p 44469000 00:00 0 4446a000-44e6a000 rw-p 4446a000 00:00 0 44e6a000-44e6b000 ---p 44e6a000 00:00 0 44e6b000-4586b000 rw-p 44e6b000 00:00 0 4586b000-4586c000 ---p 4586b000 00:00 0 4586c000-4626c000 rw-p 4586c000 00:00 0 4626c000-4626d000 ---p 4626c000 00:00 0 4626d000-46c6d000 rw-p 4626d000 00:00 0 46c6d000-46c6e000 ---p 46c6d000 00:00 0 46c6e000-4766e000 rw-p 46c6e000 00:00 0 4766e000-4766f000 ---p 4766e000 00:00 0 4766f000-4806f000 rw-p 4766f000 00:00 0 4806f000-48070000 ---p 4806f000 00:00 0 48070000-48a70000 rw-p 48070000 00:00 0 48a70000-48a71000 ---p 48a70000 00:00 0 48a71000-49471000 rw-p 48a71000 00:00 0 49471000-49472000 ---p 49471000 00:00 0 49472000-49e72000 rw-p 49472000 00:00 0 49e72000-49e73000 ---p 49e72000 00:00 0 49e73000-4a873000 rw-p 49e73000 00:00 0 4a873000-4a874000 ---p 4a873000 00:00 0 4a874000-4b274000 rw-p 4a874000 00:00 0 4b274000-4b275000 ---p 4b274000 00:00 0 4b275000-4bc75000 rw-p 4b275000 00:00 0 4bc75000-4bc76000 ---p 4bc75000 00:00 0 4bc76000-4bc79000 rw-p 4bc76000 00:00 0 3190800000-319081c000 r-xp 00000000 08:01 360758 /lib64/ld-2.5.so 3190a1b000-3190a1c000 r--p 0001b000 08:01 360758 /lib64/ld-2.5.so 3190a1c000-3190a1d000 rw-p 0001c000 08:01 360758 /lib64/ld-2.5.so 3190c00000-3190d4d000 r-xp 00000000 08:01 360759 /lib64/libc-2.5.so 3190d4d000-3190f4d000 ---p 0014d000 08:01 360759 /lib64/libc-2.5.so 3190f4d000-3190f51000 r--p 0014d000 08:01 360759 /lib64/libc-2.5.so 3190f51000-3190f52000 rw-p 00151000 08:01 360759 /lib64/libc-2.5.so 3190f52000-3190f57000 rw-p 3190f52000 00:00 0 3191000000-3191002000 r-xp 00000000 08:01 360760 /lib64/libdl-2.5.so 3191002000-3191202000 ---p 00002000 08:01 360760 /lib64/libdl-2.5.so 3191202000-3191203000 r--p 00002000 08:01 360760 /lib64/libdl-2.5.so 3191203000-3191204000 rw-p 00003000 08:01 360760 /lib64/libdl-2.5.so 3191400000-3191416000 r-xp 00000000 08:01 360450 /lib64/libpthread-2.5.so 3191416000-3191615000 ---p 00016000 08:01 360450 /lib64/libpthread-2.5.so 3191615000-3191616000 r--p 00015000 08:01 360450 /lib64/libpthread-2.5.so 3191616000-3191617000 rw-p 00016000 08:01 360450 /lib64/libpthread-2.5.so 3191617000-319161b000 rw-p 3191617000 00:00 0 3191800000-3191882000 r-xp 00000000 08:01 360764 /lib64/libm-2.5.so 3191882000-3191a81000 ---p 00082000 08:01 360764 /lib64/libm-2.5.so 3191a81000-3191a82000 r--p 00081000 08:01 360764 /lib64/libm-2.5.so 3191a82000-3191a83000 rw-p 00082000 08:01 360764 /lib64/libm-2.5.so 3192000000-3192007000 r-xp 00000000 08:01 360766 /lib64/librt-2.5.so 3192007000-3192207000 ---p 00007000 08:01 360766 /lib64/librt-2.5.so 3192207000-3192208000 r--p 00007000 08:01 360766 /lib64/librt-2.5.so 3192208000-3192209000 rw-p 00008000 08:01 360766 /lib64/librt-2.5.so 3193000000-319300f000 r-xp 00000000 08:03 1737947 /usr/lib64/libbz2.so.1.0.3 319300f000-319320e000 ---p 0000f000 08:03 1737947 /usr/lib64/libbz2.so.1.0.3 319320e000-3193210000 rw-p 0000e000 08:03 1737947 /usr/lib64/libbz2.so.1.0.3 3195800000-3195815000 r-xp 00000000 08:01 360650 /lib64/libnsl-2.5.so 3195815000-3195a14000 ---p 00015000 08:01 360650 /lib64/libnsl-2.5.so 3195a14000-3195a15000 r--p 00014000 08:01 360650 /lib64/libnsl-2.5.so 3195a15000-3195a16000 rw-p 00015000 08:01 360650 /lib64/libnsl-2.5.so 3195a16000-3195a18000 rw-p 3195a16000 00:00 0 3197000000-3197011000 r-xp 00000000 08:01 360523 /lib64/libresolv-2.5.so 3197011000-3197211000 ---p 00011000 08:01 360523 /lib64/libresolv-2.5.so 3197211000-3197212000 r--p 00011000 08:01 360523 /lib64/libresolv-2.5.so 3197212000-3197213000 rw-p 00012000 08:01 360523 /lib64/libresolv-2.5.so 3197213000-3197215000 rw-p 3197213000 00:00 0 2aaaac000000-2aaaafff4000 rw-p 2aaaac000000 00:00 0 2aaaafff4000-2aaab0000000 ---p 2aaaafff4000 00:00 0 2aaab0000000-2aaab4000000 rw-p 2aaab0000000 00:00 0 2aaab4000000-2aaab8000000 rw-p 2aaab4000000 00:00 0 2aaab8000000-2aaabc000000 rw-p 2aaab8000000 00:00 0 2aaabc000000-2aaac0000000 rw-p 2aaabc000000 00:00 0 2aaac0000000-2aaac4000000 rw-p 2aaac0000000 00:00 0 2aaac4000000-2aaac7ff3000 rw-p 2aaac4000000 00:00 0 2aaac7ff3000-2aaac8000000 ---p 2aaac7ff3000 00:00 0 2aaac8000000-2aaacfff7000 rw-p 2aaac8000000 00:00 0 2aaacfff7000-2aaad0000000 ---p 2aaacfff7000 00:00 0 2aaad0000000-2aaad4000000 rw-p 2aaad0000000 00:00 0 2aaad4000000-2aaad7fff000 rw-p 2aaad4000000 00:00 0 2aaad7fff000-2aaad8000000 ---p 2aaad7fff000 00:00 0 2aaad8000000-2aaadc000000 rw-p 2aaad8000000 00:00 0 2aaadc000000-2aaae0000000 rw-p 2aaadc000000 00:00 0 2aaae0000000-2aaae4000000 rw-p 2aaae0000000 00:00 0 2aaae4000000-2aaae7ff3000 rw-p 2aaae4000000 00:00 0 2aaae7ff3000-2aaae8000000 ---p 2aaae7ff3000 00:00 0 2aaae8000000-2aaaebffc000 rw-p 2aaae8000000 00:00 0 2aaaebffc000-2aaaec000000 ---p 2aaaebffc000 00:00 0 2aaaec000000-2aaaefffb000 rw-p 2aaaec000000 00:00 0 2aaaefffb000-2aaaf0000000 ---p 2aaaefffb000 00:00 0 2aaaf0000000-2aaaf3ffa000 rw-p 2aaaf0000000 00:00 0 2aaaf3ffa000-2aaaf4000000 ---p 2aaaf3ffa000 00:00 0 2aaaf4000000-2aaaf7ff5000 rw-p 2aaaf4000000 00:00 0 2aaaf7ff5000-2aaaf8000000 ---p 2aaaf7ff5000 00:00 0 2aaaf8000000-2aab00000000 rw-p 2aaaf8000000 00:00 0 2aab00000000-2aab03ce6000 rw-p 2aab00000000 00:00 0 2aab03ce6000-2aab04000000 ---p 2aab03ce6000 00:00 0 2aab04000000-2aab07af9000 rw-p 2aab04000000 00:00 0 2aab07af9000-2aab08000000 ---p 2aab07af9000 00:00 0 2aab08000000-2aab0b651000 rw-p 2aab08000000 00:00 0 2aab0b651000-2aab0c000000 ---p 2aab0b651000 00:00 0 2b1609be5000-2b1609be7000 rw-p 2b1609be5000 00:00 0 2b1609be7000-2b1609bfe000 r-xp 00000000 08:11 8781832 /data1/tokyotyrant/lib/libtokyotyrant.so.3.24.0 2b1609bfe000-2b1609dfe000 ---p 00017000 08:11 8781832 /data1/tokyotyrant/lib/libtokyotyrant.so.3.24.0 2b1609dfe000-2b1609dff000 rw-p 00017000 08:11 8781832 /data1/tokyotyrant/lib/libtokyotyrant.so.3.24.0 2b1609dff000-2b1609e87000 r-xp 00000000 08:11 4194315 /data1/tokyocabinet/lib/libtokyocabinet.so.9.10.0 2b1609e87000-2b160a086000 ---p 00088000 08:11 4194315 /data1/tokyocabinet/lib/libtokyocabinet.so.9.10.0 2b160a086000-2b160a088000 rw-p 00087000 08:11 4194315 /data1/tokyocabinet/lib/libtokyocabinet.so.9.10.0 2b160a09a000-2b160a09f000 rw-p 2b160a09a000 00:00 0 7fff9284b000-7fff92863000 rw-p 7ffffffe7000 00:00 0 [stack] ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 [vdso] [root@localhost ~]# |