{"id":1105,"date":"2022-01-07T16:55:05","date_gmt":"2022-01-07T08:55:05","guid":{"rendered":"http:\/\/refusea.com\/?p=1105"},"modified":"2022-01-07T17:08:57","modified_gmt":"2022-01-07T09:08:57","slug":"%e8%ae%b0%e4%b8%80%e6%ac%a1%e5%86%85%e5%ad%98%e6%b3%84%e9%9c%b2%e7%9a%84%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"https:\/\/refusea.com\/?p=1105","title":{"rendered":"\u8bb0\u4e00\u6b21\u5185\u5b58\u6cc4\u9732\u7684\u5904\u7406"},"content":{"rendered":"<h1>\u80cc\u666f<\/h1>\n<p>\u4e4b\u524d\u6709\u4e2a\u670d\u52a1\u5076\u5c14\u4f1a\u5361\u6b7b\uff0c\u5c31\u662f\u8fdb\u7a0b\u8fd8\u5728\uff0c\u4f46\u662f\u4e0d\u80fd\u5904\u7406\u4efb\u4f55\u8bf7\u6c42\u3002<br \/>\n\u4e0d\u4ec5\u662f\u4e0d\u80fd\u5904\u7406\u5916\u90e8\u8bf7\u6c42\uff0c\u5185\u90e8\u4e00\u4e2a\u5b9a\u65f6\u7ed9\u6ce8\u518c\u4e2d\u5fc3\u53d1\u9001\u5fc3\u8df3\u7684\u7ebf\u7a0b\u4e5f\u7f62\u5de5\u4e86\uff0c\u5bfc\u81f4\u6ce8\u518c\u4e2d\u5fc3\u628a\u670d\u52a1\u8282\u70b9\u7ed9\u6458\u9664\u4e86\u3002<br \/>\n\u7531\u4e8e\u670d\u52a1\u8282\u70b9\u8f83\u591a\uff0c\u5c11\u4e86\u4e00\u4e24\u4e2a\u5e76\u4e0d\u5f71\u54cd\u4e1a\u52a1\uff0c\u6240\u4ee5\u4e5f\u6ca1\u6709\u592a\u5173\u6ce8\uff0c\u6709\u65f6\u5019\u5de1\u68c0\u53d1\u73b0\u670d\u52a1\u6302\u4e86\uff0c\u91cd\u542f\u4e00\u4e0b\u5c31\u6b63\u5e38\u4e86<br \/>\n\u540e\u6765\u6211\u628a\u65e5\u5fd7\u63a5\u5165\u5230 ELK \u4e0a\uff0c\u5e76\u4e14\u4e00\u6bb5\u65f6\u95f4\u5185\u6ca1\u6709\u65e5\u5fd7\u8f93\u51fa\u4f1a\u53d1\u51fa\u544a\u8b66\uff0c\u8fd9\u4e2a\u95ee\u9898\u624d\u7b97\u662f\u80fd\u6bd4\u8f83\u53ca\u65f6\u7684\u53d1\u73b0\u4e86<\/p>\n<h1>\u521d\u6b65\u5206\u6790<\/h1>\n<p>\u4e00\u5f00\u59cb\uff0c\u6211\u8bd5\u56fe\u53d1\u73b0\u95ee\u9898\u51fa\u73b0\u7684\u67d0\u79cd\u89c4\u5f8b\uff0c\u7ecf\u8fc7\u7814\u7a76\uff0c\u6211\u53d1\u73b0\u95ee\u9898\u7684\u51fa\u73b0\u662f\u6ca1\u6709\u4ec0\u4e48\u89c4\u5f8b\u7684<\/p>\n<ul>\n<li>\u4e00\u822c\u591a\u53d1\u4e8e\u4e1a\u52a1\u9ad8\u5cf0\u671f\uff0c\u4f46\u4e5f\u6709\u5728\u4e1a\u52a1\u91cf\u6700\u4f4e\u5cf0\u7684\u65f6\u5019\u5361\u6b7b\u8fc7<\/li>\n<li>\u6709\u65f6\u5019\u91cd\u542f\u4e86\u80fd\u8fde\u7eed\u6b63\u5e38\u8fd0\u884c\u4e00\u5468\u591a\uff0c\u6709\u65f6\u5019\u4e0a\u5348\u521a\u91cd\u542f\u8fc7\uff0c\u4e0b\u5348\u53c8\u5361\u6b7b\u4e86<\/li>\n<\/ul>\n<p>\u8fd9\u5c31\u8ba9\u4eba\u5934\u5927\u4e86\uff0c\u6211\u53ea\u597d\u5728\u4ee3\u7801\u91cc\u52a0\u4e86\u4e9b\u65e5\u5fd7\u548c\u8c03\u8bd5\uff0c\u60f3\u627e\u51fa\u95ee\u9898\u6765\uff0c\u8fd9\u8fd8\u771f\u8ba9\u6211\u53d1\u73b0\u4e86\u4e00\u70b9\u89c4\u5f8b<\/p>\n<ul>\n<li>\u5728\u670d\u52a1\u6b63\u5e38\u8fd0\u884c\u65f6\uff0c\u5185\u5b58\u5360\u7528\u57fa\u672c\u662f\u5e73\u6ed1\u7684\uff0c\u5728 50% \u4e0a\u4e0b\u6d6e\u52a8\uff0c\u4f46\u4ece\u67d0\u4e2a\u65f6\u95f4\u70b9\u5f00\u59cb\uff0c\u5185\u5b58\u5360\u7528\u5c31\u5f00\u59cb\u76f4\u7ebf\u4e0a\u5347\uff0c\u4ece 50% \u5f88\u5feb\u4e0a\u6da8\u5230 90% \u591a<\/li>\n<li>\u6b64\u65f6\uff0c\u670d\u52a1\u91cc\u5404\u63a5\u53e3\u7684\u54cd\u5e94\u65f6\u95f4\u4f1a\u53d8\u6162\uff0c\u6211\u76d1\u63a7\u4e86\u4e00\u4e2a\u8c03\u7528\u8f83\u4e3a\u9891\u7e41\u7684\u63a5\u53e3\uff0c\u6b63\u5e38\u60c5\u51b510 ms \u5c31\u8fd4\u56de\u4e86\uff0c \u4f46\u51fa\u95ee\u9898\u65f6\uff0c\u5176\u54cd\u5e94\u65f6\u95f4\u9010\u6e10\u4ece 10 ms \u5230 \u6570\u767e\u6beb\u79d2\uff0c\u51e0\u79d2\uff0c\u51e0\u5341\u79d2\uff0c\u76f4\u81f3\u670d\u52a1\u5361\u6b7b\u4e0d\u518d\u54cd\u5e94<\/li>\n<\/ul>\n<p>\u6700\u521d\u6211\u4ee5\u4e3a\u6211\u7f13\u5b58\u7684\u6570\u636e\u91cf\u592a\u5927\u4e86\uff0c\u6bd4\u5982\u6709\u4e2a\u4e1a\u52a1\u8981\u57fa\u4e8e ip \u5730\u5740\u8fd4\u56de\u7528\u6237\u6240\u5728\u7684\u56fd\u5bb6\uff0c\u6211\u4eec\u5229\u7528\u5f00\u6e90\u7684 GeoLite2 \u5b9e\u73b0\u7684\uff0c\u6bcf\u4e2a\u67e5\u8be2\u8fc7\u7684 ip \u90fd\u4f1a\u7f13\u5b58\u8d77\u6765<br \/>\n\u4e8e\u662f\u6211\u8c03\u6574\u4e86\u7f13\u5b58\u7684\u5bb9\u91cf\u548c\u8fc7\u671f\u7b56\u7565\uff0c\u7ecf\u8fc7\u89c2\u5bdf\u540e\u53d1\u73b0\u6ca1\u4ec0\u4e48\u6548\u679c\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\u5185\u5b58\u5360\u7528\u5c31\u662f 50% \u5de6\u53f3\uff0c\u4e00\u65e6\u51fa\u95ee\u9898\u4e86\uff0c\u5f88\u5feb\u5c31\u98d9\u6da8\u5230 90% \u4ee5\u4e0a\uff0c\u5e94\u8be5\u548c\u7f13\u5b58\u65e0\u5173<\/p>\n<p>\u540e\u6765\u6211\u628a\u76ee\u5149\u8f6c\u79fb\u5230 redis \u4e0a\uff0c\u4f1a\u4e0d\u4f1a\u662f redis \u62bd\u98ce\u4e86\u5462\uff1f<br \/>\n\u6211\u7814\u7a76\u4e86 redis \u7684\u6162\u65e5\u5fd7\uff0c\u8fd8\u771f\u6709\u53d1\u73b0\uff0c\u6709\u4e2a\u540c\u4e8b\u4f7f\u7528\u4e86 <code>keys *<\/code> \u8fd9\u6837\u7684\u547d\u4ee4\uff0c\u54cd\u5e94\u65f6\u95f4\u9ad8\u8fbe 400 \u591a ms\uff0c\u628a\u8fd9\u7c7b\u7684\u547d\u4ee4\u5168\u90e8\u6539\u6210 scan \u540e\uff0c\u54cd\u5e94\u65f6\u95f4\u8d85\u8fc7 100 ms \u7684\u6162\u65e5\u5fd7\u5df2\u7ecf\u6ca1\u6709\u4e86\uff0c\u4f46\u662f\u670d\u52a1\u795e\u79d8\u5361\u6b7b\u7684\u95ee\u9898\u8fd8\u662f\u6ca1\u6709\u89e3\u51b3<\/p>\n<h1>GC<\/h1>\n<p>\u6211\u8c03\u51fa GC \u65e5\u5fd7\uff0c\u53d1\u73b0\u5728\u51fa\u95ee\u9898\u7684\u65f6\u5019\uff0c\u4f1a\u9891\u7e41\u7684 full GC\uff0c\u4f46\u662f\u5e76\u4e0d\u80fd\u91ca\u653e\u5185\u5b58<br \/>\n\u5148\u770b\u4e0b\u6b63\u5e38\u60c5\u51b5\u7684 GC<\/p>\n<pre><code>{Heap before GC invocations=0 (full 0):\n par new generation   total 2764800K, used 2457600K [0x00000005be000000, 0x0000000679800000, 0x0000000679800000)\n  eden space 2457600K, 100% used [0x00000005be000000, 0x0000000654000000, 0x0000000654000000)\n  from space 307200K,   0% used [0x0000000654000000, 0x0000000654000000, 0x0000000666c00000)\n  to   space 307200K,   0% used [0x0000000666c00000, 0x0000000666c00000, 0x0000000679800000)\n concurrent mark-sweep generation total 5120000K, used 0K [0x0000000679800000, 0x00000007b2000000, 0x00000007f0800000)\n Metaspace       used 61238K, capacity 62908K, committed 63104K, reserved 1105920K\n  class space    used 7095K, capacity 7455K, committed 7552K, reserved 1048576K\n\n[GC (Allocation Failure) : [ParNew\nDesired survivor size 157286400 bytes, new threshold 6 (max 6)\n- age   1:   80286472 bytes,   80286472 total\n: 2457600K-&gt;79036K(2764800K), 0.0835217 secs] 2457600K-&gt;79036K(7884800K), 0.0836609 secs] [Times: user=0.34 sys=0.06, real=0.09 secs] \nHeap after GC invocations=1 (full 0):\n par new generation   total 2764800K, used 79036K [0x00000005be000000, 0x0000000679800000, 0x0000000679800000)\n  eden space 2457600K,   0% used [0x00000005be000000, 0x00000005be000000, 0x0000000654000000)\n  from space 307200K,  25% used [0x0000000666c00000, 0x000000066b92f1e8, 0x0000000679800000)\n  to   space 307200K,   0% used [0x0000000654000000, 0x0000000654000000, 0x0000000666c00000)\n concurrent mark-sweep generation total 5120000K, used 0K [0x0000000679800000, 0x00000007b2000000, 0x00000007f0800000)\n Metaspace       used 61238K, capacity 62908K, committed 63104K, reserved 1105920K\n  class space    used 7095K, capacity 7455K, committed 7552K, reserved 1048576K\n}<\/code><\/pre>\n<p>\u53ef\u4ee5\u770b\u5230\uff0c\u8fd9\u662f\u4e00\u6b21 minor gc\uff0c\u5728 GC \u524d\uff0ceden \u533a\u5360\u7528\u662f 100%\uff0c\u800c from\u3001to \u533a\u5360\u7528\u662f 0%\uff0cGC \u540e eden \u533a\u5360\u7528\u662f 0%\uff0c from \u5360\u7528 25%\uff0cto \u5360\u7528 0%<br \/>\n\u8fd9\u8bf4\u660e GC \u56de\u6536\u4e86\u5927\u91cf\u5185\u5b58\uff0c\u800c\u51fa\u95ee\u9898\u65f6\u5019\u7684\u65e5\u5fd7\u662f\u8fd9\u6837\u7684<\/p>\n<pre><code>[Full GC (Allocation Failure) [CMS: 6143999K-&gt;6143999K(6144000K), 12.6006547 secs] 8908539K-&gt;8908446K(8908800K), [Metaspace: 88611K-&gt;88611K(1132544K)], 12.6008250 secs] [Times: user=12.55 sys=0.06, real=12.60 secs] \nHeap after GC invocations=1345 (full 765):\n par new generation   total 2764800K, used 2764446K [0x00000005be000000, 0x0000000679800000, 0x0000000679800000)\n  eden space 2457600K, 100% used [0x00000005be000000, 0x0000000654000000, 0x0000000654000000)\n  from space 307200K,  99% used [0x0000000666c00000, 0x00000006797a78a0, 0x0000000679800000)\n  to   space 307200K,   0% used [0x0000000654000000, 0x0000000654000000, 0x0000000666c00000)\n concurrent mark-sweep generation total 6144000K, used 6143999K [0x0000000679800000, 0x00000007f0800000, 0x00000007f0800000)\n Metaspace       used 88611K, capacity 91828K, committed 92928K, reserved 1132544K\n  class space    used 9185K, capacity 9792K, committed 9984K, reserved 1048576K\n}\n{Heap before GC invocations=1345 (full 765):\n par new generation   total 2764800K, used 2764446K [0x00000005be000000, 0x0000000679800000, 0x0000000679800000)\n  eden space 2457600K, 100% used [0x00000005be000000, 0x0000000654000000, 0x0000000654000000)\n  from space 307200K,  99% used [0x0000000666c00000, 0x00000006797a78a0, 0x0000000679800000)\n  to   space 307200K,   0% used [0x0000000654000000, 0x0000000654000000, 0x0000000666c00000)\n concurrent mark-sweep generation total 6144000K, used 6143999K [0x0000000679800000, 0x00000007f0800000, 0x00000007f0800000)\n Metaspace       used 88611K, capacity 91828K, committed 92928K, reserved 1132544K\n  class space    used 9185K, capacity 9792K, committed 9984K, reserved 1048576K\n<\/code><\/pre>\n<p>\u6b64\u65f6\u5df2\u7ecf\u662f full gc \u4e86\uff0cGC \u524d eden \u5360\u7528 100%\uff0c from \u5360\u7528 99%\uff0c GC \u540e\u7684\u5360\u7528\u4f9d\u7136\u662f eden 100%\uff0c from 99%\uff0c\u5b8c\u5168\u6ca1\u6709\u91ca\u653e\u51fa\u5185\u5b58<br \/>\n\u8fd9\u4e5f\u5bfc\u81f4\u4e86 full GC \u4e0d\u65ad\u7684\u91cd\u8bd5\uff0c\u8fdb\u5165\u4e86\u4e00\u4e2a GC \u7684\u6b7b\u5faa\u73af<br \/>\n\u4ece\u65e5\u5fd7\u4e5f\u53ef\u4ee5\u770b\u5230\uff0c\u6b64\u65f6 full GC \u57fa\u672c\u662f\u4e0d\u505c\u6b47\u7684<\/p>\n<p>OK\uff0c\u95ee\u9898\u627e\u5230\u4e86\uff0c\u56e0\u4e3a full GC \u8fc7\u4e8e\u9891\u7e41\uff0c\u800c\u53c8\u65e0\u6cd5\u91ca\u653e\u51fa\u5185\u5b58\uff0c\u7a0b\u5e8f\u4e00\u8fb9\u8981\u6302\u8d77\u7b49\u5f85 GC \u7ed3\u675f\uff0c\u4e00\u8fb9\u53c8\u65e0\u6cd5\u521b\u5efa\u65b0\u7684\u5bf9\u8c61\uff0c\u5c31\u65e0\u6cd5\u54cd\u5e94\u5916\u90e8\u8bf7\u6c42\uff0c\u4e5f\u65e0\u6cd5\u7ef4\u6301\u4e0e\u6ce8\u518c\u4e2d\u5fc3\u7684\u5fc3\u8df3\uff0c\u6700\u7ec8\u5c31\u5361\u6b7b\u4e86<\/p>\n<p>\u95ee\u9898\u662f\uff0c\u4e3a\u4ec0\u4e48\u4f1a\u9891\u7e41\u7684 full GC \u5462\uff1f\u591a\u4e2a\u670d\u52a1\u8282\u70b9\uff0c\u786c\u4ef6\u73af\u5883\u4e5f\u57fa\u672c\u4e00\u81f4\uff0c\u4e3a\u4ec0\u4e48\u6709\u7684\u8fd0\u884c\u7684\u597d\u597d\u7684\uff0c\u6709\u7684\u5c31\u5185\u5b58\u98d9\u6da8\u4e86\u5462\uff1f<\/p>\n<p>\u6211\u8fd8\u4e00\u5ea6\u60f3\u8fc7\u662f\u4e0d\u662f jvm \u53c2\u6570\u914d\u7f6e\u6709\u95ee\u9898\uff0c\u6216\u8005\u662f\u4e0d\u662f\u8981\u6362\u4e2a\u5783\u573e\u6536\u96c6\u5668\uff0c\u751a\u81f3\u662f\u5347\u7ea7 jdk \u7684\u7248\u672c\u8bf8\u5982\u6b64\u7c7b\u7684<\/p>\n<h1>jmap &amp; EMA<\/h1>\n<p>\u5728\u53c8\u4e00\u6b21\u5361\u6b7b\u540e\uff0c\u6211\u7528 jmap \u628a\u5185\u5b58\u5806\u6808\u7ed9 dump \u51fa\u6765\u4e86\uff0c\u547d\u4ee4\u5982\u4e0b<\/p>\n<pre><code>jmap -dump:format=b,file=opt\/dump.log 29119<\/code><\/pre>\n<p>\u8fd9\u4e2a\u6587\u4ef6\u6709 10 \u591aG\uff0c\u6211\u5148\u662f\u7528 jdk \u81ea\u5e26\u7684 jvisualvm \u6765\u6253\u5f00\uff0c\u8fd9\u4e2a\u5de5\u5177\u529f\u80fd\u6709\u9650\uff0c\u53ef\u4ee5\u770b\u5230\u5185\u5b58\u91cc\u6709\u5927\u91cf <code>char[]<\/code>\uff0c<code>String<\/code>\uff0c\u8fd8\u6709\u4e1a\u52a1\u91cc\u7684\u4e00\u4e9b\u5bf9\u8c61\uff0c\u6bd4\u5982 <code>User<\/code> \u4e4b\u7c7b\u7684\uff0c\u8fd9\u4e2a\u662f\u6bd4\u8f83\u5947\u602a\u7684\uff0c\u6211\u4eec\u7684\u603b\u7528\u6237\u6570\u4e5f\u4e0d\u8fc7\u767e\u4e07\uff0c\u4f46\u662f\u5185\u5b58\u91cc\u7adf\u7136\u6709\u51e0\u767e\u4e07\u7684 <code>User<\/code> \u5b9e\u4f8b\uff0c\u800c\u6211\u4e4b\u524d\u6000\u7591\u8fc7\u7684\u7f13\u5b58\u5bf9\u8c61\uff0c\u538b\u6839\u6392\u4e0d\u4e0a\u53f7\uff0c\u4e0d\u8fc7\u4e5f\u5c31\u8fd9\u4e9b\u4e86\uff0c\u6ca1\u6709\u66f4\u8fdb\u4e00\u6b65\u7684\u4fe1\u606f<\/p>\n<p>\u6211\u53c8\u7528 elipse \u7684\u63d2\u4ef6 memory analyzer \u6765\u5206\u6790\uff0c\u7ed3\u679c\u8fd8\u662f EMA \u63d2\u4ef6\u6280\u9ad8\u4e00\u7b79\uff0c\u76f4\u63a5\u7ed9\u6211\u5b9a\u4f4d\u5230\u4ee3\u7801\u4e86<\/p>\n<p>\u9996\u5148\u662f\u6253\u5f00 memory analyzer \u89c6\u56fe<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/static.refusea.com\/2022\/01\/memleak_ema.png\" alt=\"\" \/><\/p>\n<p>\u63a5\u4e0b\u6765\u5c31\u6253\u5f00 dump \u6587\u4ef6\u5373\u53ef\uff0cEMA \u4f1a\u5217\u51fa\u53ef\u80fd\u5bfc\u81f4\u5185\u5b58\u6cc4\u6f0f\u7684\u7591\u70b9\uff0c\u751a\u81f3\u7cbe\u51c6\u5230\u67d0\u4e2a\u65b9\u6cd5<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/static.refusea.com\/2022\/01\/user_memleak_bugs.png\" alt=\"\" \/><\/p>\n<p>\u90a3\u5c31\u770b\u4e0b\u4ee3\u7801\u5427\uff0c\u8fd9\u4e00\u770b\u679c\u7136\u6709 bug<\/p>\n<p>\u6211\u4eec\u8fd9\u4e2a\u4e1a\u52a1\u662f\u5982\u679c\u7528\u6237\u53d1\u5e03\u4e86\u4e00\u4e2a\u52a8\u6001\uff0c\u5c31\u67e5\u8be2\u51fa\u4ed6\u7684\u7c89\u4e1d\uff0c\u5e76\u5c06\u8be5\u52a8\u6001\u540c\u6b65\u7ed9\u5176\u7c89\u4e1d\uff0c\u8fd9\u91cc\u7684\u4ee3\u7801\u662f\u8c03\u7528\u53e6\u4e00\u4e2a\u5fae\u670d\u52a1\uff0c\u83b7\u53d6\u5176\u6240\u6709\u7c89\u4e1d<br \/>\n\u8003\u8651\u5230\u6709\u7684\u7528\u6237\u7c89\u4e1d\u91cf\u8f83\u591a\uff0c\u6240\u4ee5\u8fd9\u4e2a\u63a5\u53e3\u662f\u5206\u9875\u7684\uff0c\u6bcf\u9875\u8fd4\u56de 100 \u4e2a\u7528\u6237\u3002\u95ee\u9898\u5c31\u51fa\u5728\u8fd9\u91cc<\/p>\n<ul>\n<li>\u5982\u679c\u67d0\u4e00\u9875\u8fd4\u56de\u7684\u7528\u6237\u6570\u5c11\u4e8e 100\uff0c\u90a3\u5c31\u8ba4\u4e3a\u5df2\u7ecf\u83b7\u53d6\u5230\u4e86\u6240\u6709\u7528\u6237\uff0c\u9000\u51fa<\/li>\n<li>\u5426\u5219\u5c31\u5faa\u73af\u8c03\u7528\u8be5\u63a5\u53e3\uff0c\u76f4\u5230\u8fd4\u56de\u7684\u7528\u6237\u6570\u5c11\u4e8e 100<\/li>\n<\/ul>\n<p>\u95ee\u9898\u662f\uff0c\u5728\u5faa\u73af\u65f6\uff0c\u6ca1\u6709\u628a\u9875\u7801\u6570\u9012\u589e\uff0c\u8fd9\u6837\u5982\u679c\u67d0\u4e2a\u7528\u6237\u7684\u7c89\u4e1d\u6570\u591a\u4e8e 100\uff0c\u5c31\u9650\u4e8e\u6b7b\u5faa\u73af\u4e86<\/p>\n<p>\u8fd9\u4e2a\u529f\u80fd\u4e0d\u662f\u4e2a\u5f88\u5e38\u7528\u7684\u529f\u80fd\uff0c\u800c\u7c89\u4e1d\u6570\u591a\u4e8e 100 \u7684\u7528\u6237\u4e5f\u5f88\u5c11\uff0c\u8fd9\u6837\u4e5f\u5f88\u597d\u7684\u89e3\u91ca\u4e86\u4e3a\u4ec0\u4e48\u6709\u65f6\u5019\u80fd\u6b63\u5e38\u8fd0\u884c\u4e00\u5468\u4ee5\u4e0a<\/p>\n<p>\u4fee\u6539\u4e86\u8fd9\u4e2a bug \u540e\uff0c\u53d1\u5e03\u4e0a\u7ebf\uff0c\u95ee\u9898\u5b8c\u7f8e\u89e3\u51b3<\/p>\n<h1>\u603b\u7ed3<\/h1>\n<p>\u57fa\u4e8e\u7ecf\u9a8c\u6211\u4e00\u76f4\u4e0d\u8ba4\u4e3a\u4ee3\u7801\u6709\u95ee\u9898\uff0c\u56e0\u4e3a\u95ee\u9898\u53ea\u662f\u5076\u53d1\uff0c\u4e14\u6ca1\u6709\u4ec0\u4e48\u89c4\u5f8b\uff0c\u6211\u5f53\u65f6\u6000\u7591\u8fc7\u540c\u4e00\u4e2a\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u7684\u5176\u4ed6\u7a0b\u5e8f\u5360\u7528\u4e86 IO \u6216\u8005 CPU \u7b49\u8d44\u6e90\uff0c\u6216\u8005\u662f redis \u54cd\u5e94\u6162\uff0c\u751a\u81f3\u662f jvm \u7684\u5783\u573e\u56de\u6536\u914d\u7f6e\u6709\u95ee\u9898&#8230;\u7ed3\u679c\u6700\u7ec8\u8fd8\u662f\u4ee3\u7801\u91cc\u7684\u4e00\u4e2a\u4f4e\u7ea7\u9519\u8bef\u5bfc\u81f4\u7684<br \/>\n\u53e6\u5916\u5c31\u662f EMA \u771f\u662f\u5e2e\u4e86\u5927\u5fd9<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f \u4e4b\u524d\u6709\u4e2a\u670d\u52a1\u5076\u5c14\u4f1a\u5361\u6b7b\uff0c\u5c31\u662f\u8fdb\u7a0b\u8fd8\u5728\uff0c\u4f46\u662f\u4e0d\u80fd\u5904\u7406\u4efb\u4f55\u8bf7\u6c42\u3002 \u4e0d\u4ec5\u662f\u4e0d\u80fd\u5904\u7406\u5916\u90e8\u8bf7\u6c42\uff0c\u5185\u90e8\u4e00\u4e2a\u5b9a\u65f6\u7ed9\u6ce8\u518c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3],"tags":[],"class_list":["post-1105","post","type-post","status-publish","format-standard","hentry","category-java","category-architecture"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8bb0\u4e00\u6b21\u5185\u5b58\u6cc4\u9732\u7684\u5904\u7406 - \u62d2\u6d77\u7a7a\u95f4<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/refusea.com\/?p=1105\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"refusea.com\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/refusea.com\/?p=1105#article\",\"isPartOf\":{\"@id\":\"https:\/\/refusea.com\/?p=1105\"},\"author\":{\"name\":\"refusea.com\",\"@id\":\"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df\"},\"headline\":\"\u8bb0\u4e00\u6b21\u5185\u5b58\u6cc4\u9732\u7684\u5904\u7406\",\"datePublished\":\"2022-01-07T08:55:05+00:00\",\"dateModified\":\"2022-01-07T09:08:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/refusea.com\/?p=1105\"},\"wordCount\":72,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df\"},\"image\":{\"@id\":\"https:\/\/refusea.com\/?p=1105#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.refusea.com\/2022\/01\/memleak_ema.png\",\"articleSection\":[\"Java\",\"\u67b6\u6784\u5e08\u7cfb\u5217\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/refusea.com\/?p=1105#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/refusea.com\/?p=1105\",\"url\":\"https:\/\/refusea.com\/?p=1105\",\"name\":\"\u8bb0\u4e00\u6b21\u5185\u5b58\u6cc4\u9732\u7684\u5904\u7406 - \u62d2\u6d77\u7a7a\u95f4\",\"isPartOf\":{\"@id\":\"https:\/\/refusea.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/refusea.com\/?p=1105#primaryimage\"},\"image\":{\"@id\":\"https:\/\/refusea.com\/?p=1105#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.refusea.com\/2022\/01\/memleak_ema.png\",\"datePublished\":\"2022-01-07T08:55:05+00:00\",\"dateModified\":\"2022-01-07T09:08:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/refusea.com\/?p=1105#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/refusea.com\/?p=1105\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/refusea.com\/?p=1105#primaryimage\",\"url\":\"https:\/\/static.refusea.com\/2022\/01\/memleak_ema.png\",\"contentUrl\":\"https:\/\/static.refusea.com\/2022\/01\/memleak_ema.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/refusea.com\/?p=1105#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/refusea.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8bb0\u4e00\u6b21\u5185\u5b58\u6cc4\u9732\u7684\u5904\u7406\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/refusea.com\/#website\",\"url\":\"https:\/\/refusea.com\/\",\"name\":\"\u62d2\u6d77\u7a7a\u95f4\",\"description\":\"\u62d2\u6d77\u7684\u4e2a\u4eba\u535a\u5ba2\",\"publisher\":{\"@id\":\"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/refusea.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df\",\"name\":\"refusea.com\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/refusea.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7f7489b4afdbd952db64e7a6704d1258?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7f7489b4afdbd952db64e7a6704d1258?s=96&d=mm&r=g\",\"caption\":\"refusea.com\"},\"logo\":{\"@id\":\"https:\/\/refusea.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/refusea.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u8bb0\u4e00\u6b21\u5185\u5b58\u6cc4\u9732\u7684\u5904\u7406 - \u62d2\u6d77\u7a7a\u95f4","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/refusea.com\/?p=1105","twitter_misc":{"\u4f5c\u8005":"refusea.com","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/refusea.com\/?p=1105#article","isPartOf":{"@id":"https:\/\/refusea.com\/?p=1105"},"author":{"name":"refusea.com","@id":"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df"},"headline":"\u8bb0\u4e00\u6b21\u5185\u5b58\u6cc4\u9732\u7684\u5904\u7406","datePublished":"2022-01-07T08:55:05+00:00","dateModified":"2022-01-07T09:08:57+00:00","mainEntityOfPage":{"@id":"https:\/\/refusea.com\/?p=1105"},"wordCount":72,"commentCount":0,"publisher":{"@id":"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df"},"image":{"@id":"https:\/\/refusea.com\/?p=1105#primaryimage"},"thumbnailUrl":"https:\/\/static.refusea.com\/2022\/01\/memleak_ema.png","articleSection":["Java","\u67b6\u6784\u5e08\u7cfb\u5217"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/refusea.com\/?p=1105#respond"]}]},{"@type":"WebPage","@id":"https:\/\/refusea.com\/?p=1105","url":"https:\/\/refusea.com\/?p=1105","name":"\u8bb0\u4e00\u6b21\u5185\u5b58\u6cc4\u9732\u7684\u5904\u7406 - \u62d2\u6d77\u7a7a\u95f4","isPartOf":{"@id":"https:\/\/refusea.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/refusea.com\/?p=1105#primaryimage"},"image":{"@id":"https:\/\/refusea.com\/?p=1105#primaryimage"},"thumbnailUrl":"https:\/\/static.refusea.com\/2022\/01\/memleak_ema.png","datePublished":"2022-01-07T08:55:05+00:00","dateModified":"2022-01-07T09:08:57+00:00","breadcrumb":{"@id":"https:\/\/refusea.com\/?p=1105#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/refusea.com\/?p=1105"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/refusea.com\/?p=1105#primaryimage","url":"https:\/\/static.refusea.com\/2022\/01\/memleak_ema.png","contentUrl":"https:\/\/static.refusea.com\/2022\/01\/memleak_ema.png"},{"@type":"BreadcrumbList","@id":"https:\/\/refusea.com\/?p=1105#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/refusea.com\/"},{"@type":"ListItem","position":2,"name":"\u8bb0\u4e00\u6b21\u5185\u5b58\u6cc4\u9732\u7684\u5904\u7406"}]},{"@type":"WebSite","@id":"https:\/\/refusea.com\/#website","url":"https:\/\/refusea.com\/","name":"\u62d2\u6d77\u7a7a\u95f4","description":"\u62d2\u6d77\u7684\u4e2a\u4eba\u535a\u5ba2","publisher":{"@id":"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/refusea.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df","name":"refusea.com","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/refusea.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7f7489b4afdbd952db64e7a6704d1258?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7f7489b4afdbd952db64e7a6704d1258?s=96&d=mm&r=g","caption":"refusea.com"},"logo":{"@id":"https:\/\/refusea.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/refusea.com"]}]}},"_links":{"self":[{"href":"https:\/\/refusea.com\/index.php?rest_route=\/wp\/v2\/posts\/1105"}],"collection":[{"href":"https:\/\/refusea.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/refusea.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/refusea.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/refusea.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1105"}],"version-history":[{"count":16,"href":"https:\/\/refusea.com\/index.php?rest_route=\/wp\/v2\/posts\/1105\/revisions"}],"predecessor-version":[{"id":1123,"href":"https:\/\/refusea.com\/index.php?rest_route=\/wp\/v2\/posts\/1105\/revisions\/1123"}],"wp:attachment":[{"href":"https:\/\/refusea.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/refusea.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/refusea.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}