{"id":10007063,"date":"2023-01-10T12:25:20","date_gmt":"2023-01-10T04:25:20","guid":{"rendered":"https:\/\/ityet.com\/?p=10007063"},"modified":"2023-01-10T12:25:20","modified_gmt":"2023-01-10T04:25:20","slug":"%e4%b8%80%e6%ac%a1jvm-gc%e9%95%bf%e6%9a%82%e5%81%9c%e7%9a%84%e6%8e%92%e6%9f%a5%e8%bf%87%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10007063","title":{"rendered":"\u4e00\u6b21JVM GC\u957f\u6682\u505c\u7684\u6392\u67e5\u8fc7\u7a0b"},"content":{"rendered":"<p><strong>\u4f5c\u8005\uff1a\u4eac\u4e1c\u79d1\u6280 \u5f90\u4f20\u4e50<\/strong><\/p>\n<h3>\u80cc\u666f<\/h3>\n<p>\u5728\u9ad8\u5e76\u53d1\u4e0b\uff0cJava\u7a0b\u5e8f\u7684GC\u95ee\u9898\u5c5e\u4e8e\u5f88\u5178\u578b\u7684\u4e00\u7c7b\u95ee\u9898\uff0c\u5e26\u6765\u7684\u5f71\u54cd\u5f80\u5f80\u4f1a\u88ab\u8fdb\u4e00\u6b65\u653e\u5927\u3002\u4e0d\u7ba1\u662f\u300cGC\u9891\u7387\u8fc7\u5feb\u300d\u8fd8\u662f\u300cGC\u8017\u65f6\u592a\u957f\u300d\uff0c\u7531\u4e8eGC\u671f\u95f4\u90fd\u5b58\u5728Stop The World\u95ee\u9898\uff0c\u56e0\u6b64\u5f88\u5bb9\u6613\u5bfc\u81f4\u670d\u52a1\u8d85\u65f6\uff0c\u5f15\u53d1\u6027\u80fd\u95ee\u9898\u3002<\/p>\n<p>\u4e8b\u60c5\u6700\u521d\u662f\u7ebf\u4e0a\u67d0\u5e94\u7528\u5783\u573e\u6536\u96c6\u51fa\u73b0Full GC\u5f02\u5e38\u7684\u73b0\u8c61\uff0c\u5e94\u7528\u4e2d\u4e2a\u522b\u5b9e\u4f8bFull GC\u65f6\u95f4\u7279\u522b\u957f\uff0c\u6301\u7eed\u65f6\u95f4\u7ea6\u4e3a15~30\u79d2\uff0c\u5e73\u5747\u6bcf2\u5468\u5de6\u53f3\u89e6\u53d1\u4e00\u6b21\uff1b<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288827\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288828\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>JVM\u53c2\u6570\u914d\u7f6e\u201c-Xms2048M \u2013Xmx2048M \u2013Xmn1024M \u2013XX:MaxPermSize=512M\u201d<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288829\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<h3>\u6392\u67e5\u8fc7\u7a0b<\/h3>\n<p>\u00d8 <strong>\u5206\u6790GC \u65e5\u5fd7<\/strong><\/p>\n<p>GC \u65e5\u5fd7\u5b83\u8bb0\u5f55\u4e86\u6bcf\u4e00\u6b21\u7684 GC \u7684\u6267\u884c\u65f6\u95f4\u548c\u6267\u884c\u7ed3\u679c\uff0c\u901a\u8fc7\u5206\u6790 GC \u65e5\u5fd7\u53ef\u4ee5\u8c03\u4f18\u5806\u8bbe\u7f6e\u548c GC \u8bbe\u7f6e\uff0c\u6216\u8005\u6539\u8fdb\u5e94\u7528\u7a0b\u5e8f\u7684\u5bf9\u8c61\u5206\u914d\u6a21\u5f0f\u3002<\/p>\n<p>\u8fd9\u91ccFull GC\u7684reason\u662fErgonomics\uff0c\u662f\u56e0\u4e3a\u5f00\u542f\u4e86UseAdaptiveSizePolicy\uff0cjvm\u81ea\u5df1\u8fdb\u884c\u81ea\u9002\u5e94\u8c03\u6574\u5f15\u53d1\u7684Full GC\u3002<\/p>\n<p>\u8fd9\u4efd\u65e5\u5fd7\u4e3b\u8981\u4f53\u73b0GC\u524d\u540e\u7684\u53d8\u5316\uff0c\u76ee\u524d\u4e3a\u6b62\u770b\u4e0d\u51fa\u4e2a\u6240\u4ee5\u7136\u6765\u3002<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288830\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>\u5f00\u542fGC\u65e5\u5fd7\uff0c\u9700\u8981\u6dfb\u52a0\u5982\u4e0b JVM \u542f\u52a8\u53c2\u6570\uff1a<\/p>\n<p>-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:\/export\/log\/risk_pillar\/gc.log<\/p>\n<p>\u5e38\u89c1\u7684 Young GC\u3001Full GC \u65e5\u5fd7\u542b\u4e49\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288831\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>\u00d8 <strong>\u8fdb\u4e00\u6b65\u67e5\u770b\u670d\u52a1\u5668\u6027\u80fd\u6307\u6807<\/strong><\/p>\n<p>\u83b7\u53d6\u5230\u4e86GC\u8017\u65f6\u7684\u65f6\u95f4\u540e\uff0c\u901a\u8fc7\u76d1\u63a7\u5e73\u53f0\u83b7\u53d6\u5230\u5404\u4e2a\u76d1\u63a7\u9879\uff0c\u5f00\u59cb\u6392\u67e5\u8fd9\u4e2a\u65f6\u70b9\u6709\u5f02\u5e38\u7684\u6307\u6807\uff0c\u6700\u7ec8\u5206\u6790\u53d1\u73b0\uff0c\u57285.06\u5206\u5de6\u53f3\uff08GC\u7684\u65f6\u70b9\uff09\uff0cCPU\u5360\u7528\u663e\u8457\u63d0\u5347\uff0c\u800cSWAP\u51fa\u73b0\u4e86\u91ca\u653e\u8d44\u6e90\u3001memory\u8d44\u6e90\u589e\u957f\u51fa\u73b0\u62d0\u70b9\u7684\u60c5\u51b5\uff08\u8be6\u89c1\u4e0b\u56fe\u7ea2\u8272\u6846\uff0c\u6a59\u8272\u6846\u4e2d\u7684\u53d8\u5316\u662f\u56e0\u4fee\u6539\u914d\u7f6e\u5bfc\u81f4\uff0c\u540e\u9762\u4f1a\u4ecb\u7ecd\uff0c\u6682\u4e14\u53ef\u5ffd\u7565\uff09<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288832\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>JVM\u7528\u5230\u4e86<strong>swap<\/strong>\uff1f\u662f\u56e0\u4e3aGC\u5bfc\u81f4\u7684CPU\u7a81\u7136\u98d9\u5347\uff0c\u5e76\u4e14\u91ca\u653e\u4e86swap\u4ea4\u6362\u533a\u8fd9\u90e8\u5206\u5185\u5b58\u5230memory\uff1f<\/p>\n<p>\u4e3a\u4e86\u9a8c\u8bc1JVM\u662f\u5426\u7528\u5230swap\uff0c\u6211\u4eec\u901a\u8fc7\u68c0\u67e5proc\u4e0b\u7684\u8fdb\u7a0b\u5185\u5b58\u8d44\u6e90\u5360\u7528\u60c5\u51b5<\/p>\n<table>\n<thead>\n<tr>\n<th>for i in $( cd \/proc;ls<\/th>\n<th>grep &#8220;^[0-9]&#8221;<\/th>\n<th>awk &#8216; $0 &gt;100&#8217;) ;do awk &#8216;\/Swap:\/{a=a+$2}END{print &#8216;&#8221;$i&quot;&#8217;,a\/1024&quot;M&quot;}&#8217; \/proc\/$i\/smaps 2&gt;\/dev\/null ; done<\/th>\n<th>sort -k2nr<\/th>\n<th>head -10 # head -10 \u8868\u793a \u53d6\u51fa \u524d10\u4e2a\u5185\u5b58\u5360\u7528\u9ad8\u7684\u8fdb\u7a0b # \u53d6\u51fa\u7684\u7b2c\u4e00\u5217\u4e3a\u8fdb\u7a0b\u7684id \u7b2c\u4e8c\u5217\u8fdb\u7a0b\u5360\u7528swap\u5927\u5c0f<\/th>\n<\/tr>\n<\/thead>\n<\/tbody>\n<\/table>\n<p>\u770b\u5230\u786e\u5b9e\u6709\u7528\u5230305MB\u7684swap<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288833\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>\u8fd9\u91cc\u7b80\u5355\u4ecb\u7ecd\u4e0b\u4ec0\u4e48\u662f<strong>swap<\/strong>?<\/p>\n<p>swap\u6307\u7684\u662f\u4e00\u4e2a\u4ea4\u6362\u5206\u533a\u6216\u6587\u4ef6\uff0c\u4e3b\u8981\u662f\u5728\u5185\u5b58\u4f7f\u7528\u5b58\u5728\u538b\u529b\u65f6\uff0c\u89e6\u53d1\u5185\u5b58\u56de\u6536\uff0c\u8fd9\u65f6\u53ef\u80fd\u4f1a\u5c06\u90e8\u5206\u5185\u5b58\u7684\u6570\u636e\u4ea4\u6362\u5230swap\u7a7a\u95f4\uff0c\u4ee5\u4fbf\u8ba9\u7cfb\u7edf\u4e0d\u4f1a\u56e0\u4e3a\u5185\u5b58\u4e0d\u591f\u7528\u800c\u5bfc\u81f4oom\u6216\u8005\u66f4\u81f4\u547d\u7684\u60c5\u51b5\u51fa\u73b0\u3002<\/p>\n<p>\u5f53\u67d0\u8fdb\u7a0b\u5411OS\u8bf7\u6c42\u5185\u5b58\u53d1\u73b0\u4e0d\u8db3\u65f6\uff0cOS\u4f1a\u628a\u5185\u5b58\u4e2d\u6682\u65f6\u4e0d\u7528\u7684\u6570\u636e\u4ea4\u6362\u51fa\u53bb\uff0c\u653e\u5728swap\u5206\u533a\u4e2d\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u79f0\u4e3aswap out\u3002<\/p>\n<p>\u5f53\u67d0\u8fdb\u7a0b\u53c8\u9700\u8981\u8fd9\u4e9b\u6570\u636e\u4e14OS\u53d1\u73b0\u8fd8\u6709\u7a7a\u95f2\u7269\u7406\u5185\u5b58\u65f6\uff0c\u53c8\u4f1a\u628aswap\u5206\u533a\u4e2d\u7684\u6570\u636e\u4ea4\u6362\u56de\u7269\u7406\u5185\u5b58\u4e2d\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u79f0\u4e3aswap in\u3002<\/p>\n<\/p>\n<p>\u4e3a\u4e86\u9a8c\u8bc1GC\u8017\u65f6\u4e0eswap\u64cd\u4f5c\u6709\u5fc5\u7136\u5173\u7cfb\uff0c\u6211\u62bd\u67e5\u4e86\u5341\u51e0\u53f0\u673a\u5668\uff0c\u91cd\u70b9\u5173\u6ce8\u8017\u65f6\u957f\u7684GC\u65e5\u5fd7\uff0c\u901a\u8fc7\u65f6\u95f4\u70b9\u786e\u8ba4\u5230GC\u8017\u65f6\u7684\u65f6\u95f4\u70b9\u4e0eswap\u64cd\u4f5c\u7684\u65f6\u95f4\u70b9\u786e\u5b9e\u662f\u4e00\u81f4\u7684\u3002<\/p>\n<p>\u8fdb\u4e00\u6b65\u67e5\u770b\u865a\u62df\u673a\u5404\u5b9e\u4f8b swappiness \u53c2\u6570\uff0c\u4e00\u4e2a\u666e\u904d\u73b0\u8c61\u662f\uff0c\u51e1\u662f\u53d1\u751f\u8f83\u957fFull GC\u7684\u5b9e\u4f8b\u90fd\u914d\u7f6e\u4e86\u53c2\u6570 vm.swappiness = 30\uff08\u503c\u8d8a\u5927\u8868\u793a\u8d8a\u503e\u5411\u4e8e\u4f7f\u7528swap\uff09\uff1b\u800cGC\u65f6\u95f4\u76f8\u5bf9\u6b63\u5e38\u7684\u5b9e\u4f8b\u914d\u7f6e\u53c2\u6570 vm.swappiness = 0\uff08\u6700\u5927\u9650\u5ea6\u5730\u964d\u4f4e\u4f7f\u7528swap\uff09\u3002<\/p>\n<p>swappiness \u53ef\u4ee5\u8bbe\u7f6e\u4e3a 0 \u5230 100 \u4e4b\u95f4\u7684\u503c\uff0c\u5b83\u662fLinux\u7684\u4e00\u4e2a\u5185\u6838\u53c2\u6570\uff0c\u63a7\u5236\u7cfb\u7edf\u5728\u8fdb \u884cswap\u65f6\uff0c\u5185\u5b58\u4f7f\u7528\u7684\u76f8\u5bf9\u6743\u91cd\u3002<\/p>\n<p>\u00d8 swappiness=0: \u8868\u793a\u6700\u5927\u9650\u5ea6\u4f7f\u7528\u7269\u7406\u5185\u5b58\uff0c\u7136\u540e\u624d\u662f swap\u7a7a\u95f4<\/p>\n<p>\u00d8 swappiness=100: \u8868\u793a\u79ef\u6781\u7684\u4f7f\u7528swap\u5206\u533a\uff0c\u5e76\u4e14\u628a\u5185\u5b58\u4e0a\u7684\u6570\u636e\u53ca\u65f6\u7684\u4ea4\u6362\u5230swap\u7a7a\u95f4\u91cc\u9762<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288834\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288835\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>\u5bf9\u5e94\u7684\u7269\u7406\u5185\u5b58\u4f7f\u7528\u7387\u548cswap\u4f7f\u7528\u60c5\u51b5\u5982\u4e0b<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288836\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288837\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>\u81f3\u6b64\uff0c\u77db\u5934\u4f3c\u4e4e\u90fd\u6307\u5411\u4e86swap\u3002<\/p>\n<p>\u00d8 <strong>\u95ee\u9898\u5206\u6790<\/strong><\/p>\n<p>\u5f53\u5185\u5b58\u4f7f\u7528\u7387\u8fbe\u5230\u6c34\u4f4d\u7ebf(vm.swappiness)\u65f6\uff0clinux\u4f1a\u628a\u4e00\u90e8\u5206\u6682\u65f6\u4e0d\u4f7f\u7528\u7684\u5185\u5b58\u6570\u636e\u653e\u5230\u78c1\u76d8swap\u53bb\uff0c\u4ee5\u4fbf\u817e\u51fa\u66f4\u591a\u53ef\u7528\u5185\u5b58\u7a7a\u95f4\uff1b<\/p>\n<p>\u5f53\u9700\u8981\u4f7f\u7528\u4f4d\u4e8eswap\u533a\u7684\u6570\u636e\u65f6\uff0c\u518d\u5c06\u5176\u6362\u56de\u5185\u5b58\u4e2d\uff0c\u5f53JVM\u8fdb\u884cGC\u65f6\uff0c\u9700\u8981\u5bf9\u76f8\u5e94\u5806\u5206\u533a\u7684\u5df2\u7528\u5185\u5b58\u8fdb\u884c\u904d\u5386\uff1b<\/p>\n<p>\u5047\u5982GC\u7684\u65f6\u5019\uff0c\u6709\u5806\u7684\u4e00\u90e8\u5206\u5185\u5bb9\u88ab\u4ea4\u6362\u5230swap\u7a7a\u95f4\u4e2d\uff0c\u904d\u5386\u5230\u8fd9\u90e8\u5206\u7684\u65f6\u5019\u5c31\u9700\u8981\u5c06\u5176\u4ea4\u6362\u56de\u5185\u5b58\uff0c\u7531\u4e8e\u9700\u8981\u8bbf\u95ee\u78c1\u76d8\uff0c\u6240\u4ee5\u76f8\u6bd4\u7269\u7406\u5185\u5b58\uff0c\u5b83\u7684\u901f\u5ea6\u80af\u5b9a\u6162\u7684\u4ee4\u4eba\u53d1\u6307\uff0cGC\u505c\u987f\u7684\u65f6\u95f4\u4e00\u5b9a\u4f1a\u975e\u5e38\u975e\u5e38\u6050\u6016\uff1b<\/p>\n<p>\u8fdb\u800c\u5bfc\u81f4Linux\u5bf9swap\u5206\u533a\u7684\u56de\u6536\u6ede\u540e\uff08\u5185\u5b58\u5230\u78c1\u76d8\u6362\u5165\u6362\u51fa\u64cd\u4f5c\u5341\u5206\u5360\u7528CPU\u4e0e\u7cfb\u7edfIO\uff09\uff0c\u5728\u9ad8\u5e76\u53d1\/QPS\u670d\u52a1\u4e2d\uff0c\u8fd9\u79cd\u6ede\u540e\u5e26\u6765\u7684\u7ed3\u679c\u662f\u81f4\u547d\u7684(STW)\u3002<\/p>\n<p>\u00d8 <strong>\u95ee\u9898\u89e3\u51b3<\/strong><\/p>\n<p>\u81f3\u6b64\uff0c\u7b54\u6848\u4f3c\u4e4e\u5f88\u6e05\u6670\uff0c\u6211\u4eec\u53ea\u9700\u5c1d\u8bd5\u628aswap\u5173\u95ed\u6216\u91ca\u653e\u6389\uff0c\u770b\u770b\u80fd\u5426\u89e3\u51b3\u95ee\u9898\uff1f<\/p>\n<p><strong>\u5982\u4f55\u91ca\u653eswap?<\/strong><\/p>\n<ol>\n<li>\u8bbe\u7f6evm.swappiness=0\uff08\u91cd\u542f\u5e94\u7528\u91ca\u653eswap\u540e\u751f\u6548\uff09\uff0c\u8868\u793a\u5c3d\u53ef\u80fd\u4e0d\u4f7f\u7528\u4ea4\u6362\u5185\u5b58<\/li>\n<\/ol>\n<p>a\u3001 \u4e34\u65f6\u8bbe\u7f6e\u65b9\u6848\uff0c\u91cd\u542f\u540e\u4e0d\u751f\u6548<\/p>\n<h2>\u8bbe\u7f6evm.swappiness\u4e3a0<\/h2>\n<p>sysctl vm.swappiness=0<\/p>\n<h2>\u67e5\u770bswappiness\u503c<\/h2>\n<p>cat \/proc\/sys\/vm\/swappiness<\/p>\n<p>b\u3001 \u6c38\u4e45\u8bbe\u7f6e\u65b9\u6848\uff0c\u91cd\u542f\u540e\u4ecd\u7136\u751f\u6548<\/p>\n<p>vi \/etc\/sysctl.conf<\/p>\n<h2>\u6dfb\u52a0<\/h2>\n<p>vm.swappiness=0<\/p>\n<ol start=\"2\">\n<li>\u5173\u95ed\u4ea4\u6362\u5206\u533aswapoff \u2013a<\/li>\n<\/ol>\n<p>\u524d\u63d0\uff1a\u9996\u5148\u8981\u4fdd\u8bc1\u5185\u5b58\u5269\u4f59\u8981\u5927\u4e8e\u7b49\u4e8eswap\u4f7f\u7528\u91cf\uff0c\u5426\u5219\u4f1a\u62a5Cannot allocate memory\uff01swap\u5206\u533a\u4e00\u65e6\u91ca\u653e\uff0c\u6240\u6709\u5b58\u653e\u5728swap\u5206\u533a\u7684\u6587\u4ef6\u90fd\u4f1a\u8f6c\u5b58\u5230\u7269\u7406\u5185\u5b58\u4e0a\uff0c\u53ef\u80fd\u4f1a\u5f15\u53d1\u7cfb\u7edfIO\u6216\u8005\u5176\u4ed6\u95ee\u9898\u3002<\/p>\n<p>a\u3001 \u67e5\u770b\u5f53\u524dswap\u5206\u533a\u6302\u8f7d\u5728\u54ea\uff1f<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288838\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>b\u3001 \u5173\u505c\u5206\u533a<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288839\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>\u5173\u95edswap\u4ea4\u6362\u533a\u540e\u7684\u5185\u5b58\u53d8\u5316\u89c1\u4e0b\u56fe\u6a59\u8272\u6846\uff0c\u6b64\u65f6swap\u5206\u533a\u7684\u6587\u4ef6\u90fd\u8f6c\u5b58\u5230\u4e86\u7269\u7406\u5185\u5b58\u4e0a<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288840\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>\u5173\u95edSwap\u4ea4\u6362\u533a\u540e\uff0c\u4e8e2.23\u518d\u6b21\u53d1\u751fFull GC\uff0c\u8017\u65f6190ms\uff0c\u95ee\u9898\u5f97\u5230\u89e3\u51b3\u3002<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288841\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>\u00d8 <strong>\u7591\u60d1<\/strong><\/p>\n<p><strong>1\u3001 \u662f\u4e0d\u662f\u53ea\u8981\u5f00\u542f\u4e86swap\u4ea4\u6362\u533a\u7684JVM\uff0c\u5728GC\u7684\u65f6\u5019\u90fd\u4f1a\u8017\u65f6\u8f83\u957f\u5462\uff1f<\/strong><\/p>\n<p><strong>2\u3001 \u65e2\u7136JVM\u5bf9swap\u5982\u6b64\u4e0d\u5f85\u89c1\uff0c\u4e3a\u4f55JVM\u4e0d\u660e\u4ee4\u7981\u6b62\u4f7f\u7528\u5462\uff1f<\/strong><\/p>\n<p><strong>3\u3001 swap\u5de5\u4f5c\u673a\u5236\u662f\u600e\u6837\u7684\uff1f\u8fd9\u53f0\u7269\u7406\u5185\u5b58\u4e3a8g\u7684server\uff0c\u4f7f\u7528\u4e86\u4ea4\u6362\u533a\u5185\u5b58\uff08swap\uff09\uff0c\u8bf4\u660e\u7269\u7406\u5185\u5b58\u4e0d\u591f\u4f7f\u7528\u4e86\uff0c\u4f46\u662f\u901a\u8fc7free\u547d\u4ee4\u67e5\u770b\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\uff0c\u5b9e\u9645\u7269\u7406\u5185\u5b58\u4f3c\u4e4e\u5e76\u6ca1\u6709\u5360\u7528\u90a3\u4e48\u591a\uff0c\u53cd\u800cSwap\u5df2\u5360\u8fd11G\uff1f<\/strong><\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288842\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>free\uff1a\u9664\u4e86buff\/cache\u5269\u4f59\u4e86\u591a\u5c11\u5185\u5b58<\/p>\n<p>shared\uff1a\u5171\u4eab\u5185\u5b58<\/p>\n<p>buff\/cache\uff1a\u7f13\u51b2\u3001\u7f13\u5b58\u533a\u5185\u5b58\u6570\uff08\u4f7f\u7528\u8fc7\u9ad8\u901a\u5e38\u662f\u7a0b\u5e8f\u9891\u7e41\u5b58\u53d6\u6587\u4ef6\uff09<\/p>\n<p>available\uff1a\u771f\u5b9e\u5269\u4f59\u7684\u53ef\u7528\u5185\u5b58\u6570<\/p>\n<hr>\n<p>\u5927\u5bb6\u53ef\u4ee5\u60f3\u60f3\uff0c\u5173\u95ed\u4ea4\u6362\u78c1\u76d8\u7f13\u5b58\u610f\u5473\u7740\u4ec0\u4e48\uff1f<\/p>\n<p>\u5176\u5b9e\u5927\u53ef\u4e0d\u5fc5\u5982\u6b64\u6fc0\u8fdb\uff0c\u8981\u77e5\u9053\u8fd9\u4e2a\u4e16\u754c\u6c38\u8fdc\u4e0d\u662f\u975e0\u53731\u7684\uff0c\u5927\u5bb6\u90fd\u4f1a\u6216\u591a\u6216\u5c11\u9009\u62e9\u8d70\u5728\u4e2d\u95f4\uff0c\u4e0d\u8fc7\u6709\u4e9b\u504f\u54110\uff0c\u6709\u4e9b\u504f\u54111\u800c\u5df2\u3002<\/p>\n<p>\u5f88\u663e\u7136\uff0c\u5728swap\u8fd9\u4e2a\u95ee\u9898\u4e0a\uff0cJVM\u53ef\u4ee5\u9009\u62e9\u504f\u5411\u5c3d\u91cf\u5c11\u7528\uff0c\u4ece\u800c\u964d\u4f4eswap\u5f71\u54cd\uff0c\u8981\u964d\u4f4eswap\u5f71\u54cd\u6709\u5fc5\u8981\u5f04\u6e05\u695aLinux\u5185\u5b58\u56de\u6536\u662f\u600e\u4e48\u5de5\u4f5c\u7684\uff0c\u8fd9\u6837\u624d\u80fd\u4e0d\u9057\u6f0f\u4efb\u4f55\u53ef\u80fd\u7684\u7591\u70b9\u3002<\/p>\n<p><strong>\u5148\u6765\u770b\u770bswap\u662f\u5982\u4f55\u89e6\u53d1\u7684\uff1f<\/strong><\/p>\n<p>Linux\u4f1a\u5728\u4e24\u79cd\u573a\u666f\u4e0b\u89e6\u53d1\u5185\u5b58\u56de\u6536\uff0c\u4e00\u79cd\u662f\u5728\u5185\u5b58\u5206\u914d\u65f6\u53d1\u73b0\u6ca1\u6709\u8db3\u591f\u7a7a\u95f2\u5185\u5b58\u65f6\u4f1a\u7acb\u523b\u89e6\u53d1\u5185\u5b58\u56de\u6536\uff1b\u53e6\u4e00\u79cd\u662f\u5f00\u542f\u4e86\u4e00\u4e2a\u5b88\u62a4\u8fdb\u7a0b\uff08kswapd\u8fdb\u7a0b\uff09\u5468\u671f\u6027\u5bf9\u7cfb\u7edf\u5185\u5b58\u8fdb\u884c\u68c0\u67e5\uff0c\u5728\u53ef\u7528\u5185\u5b58\u964d\u4f4e\u5230\u7279\u5b9a\u9608\u503c\u4e4b\u540e\u4e3b\u52a8\u89e6\u53d1\u5185\u5b58\u56de\u6536\u3002<\/p>\n<p>\u901a\u8fc7\u5982\u4e0b\u56fe\u793a\u53ef\u4ee5\u5f88\u5bb9\u6613\u7406\u89e3\uff0c\u8be6\u7ec6\u4fe1\u606f\u53c2\u89c1\uff1a<a href=\"https:\/\/link.segmentfault.com\/?enc=Z8MLyy4llL1T20%2F8EUZP3w%3D%3D.ioLaTIffy8f5ceZNp5HLE%2FFDktmtmdxMyecaNmUWjl3ek1XVLKfYGC84HBEdKxtr\" rel=\"nofollow\">http:\/\/hbasefly.com\/2017\/05\/2&#8230;<\/a><\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288843\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p><strong>\u89e3\u7b54\u662f\u4e0d\u662f\u53ea\u8981\u5f00\u542f\u4e86swap\u4ea4\u6362\u533a\u7684JVM\uff0c\u5728GC\u7684\u65f6\u5019\u90fd\u4f1a\u8017\u65f6\u8f83\u957f<\/strong><\/p>\n<p>\u7b14\u8005\u53bb\u67e5\u4e86\u4e00\u4e0b\u53e6\u5916\u7684\u4e00\u4e2a\u5e94\u7528\uff0c\u76f8\u5173\u6307\u6807\u4fe1\u606f\u8bf7\u89c1\u4e0b\u56fe\u3002<\/p>\n<p>\u5b9e\u540d\u670d\u52a1\u7684QPS\u662f\u975e\u5e38\u9ad8\u7684\uff0c\u540c\u6837\u80fd\u770b\u5230\u5e94\u7528\u4e86swap\uff0cGC\u5e73\u5747\u8017\u65f6 576ms\uff0c\u8fd9\u662f\u4e3a\u4ec0\u4e48\u5462\uff1f<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288844\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288845\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>\u901a\u8fc7\u628a\u65f6\u95f4\u8303\u56f4\u805a\u7126\u5230\u53d1\u751fGC\u7684\u67d0\u4e00\u65f6\u95f4\u6bb5\uff0c\u4ece\u76d1\u63a7\u6307\u6807\u56fe\u53ef\u4ee5\u770b\u5230swapUsed\u6ca1\u6709\u4efb\u4f55\u53d8\u5316\uff0c\u4e5f\u5c31\u662f\u8bf4\u6ca1\u6709swap\u6d3b\u52a8\uff0c\u8fdb\u800c\u6ca1\u6709\u5f71\u54cd\u5230\u5783\u7ea7\u56de\u6536\u7684\u603b\u8017\u65f6\u3002<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288846\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288847\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>\u901a\u8fc7\u5982\u4e0b\u547d\u4ee4\u5217\u4e3e\u51fa\u5404\u8fdb\u7a0bswap\u7a7a\u95f4\u5360\u7528\u60c5\u51b5\uff0c\u5f88\u6e05\u695a\u7684\u770b\u5230\u5b9e\u540d\u8fd9\u4e2a\u670d\u52a1swap\u7a7a\u95f4\u5360\u7528\u7684\u8f83\u5c11\uff08\u4ec554.2MB\uff09<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288848\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>\u53e6\u4e00\u4e2a\u663e\u8457\u7684\u73b0\u8c61\u662f\u5b9e\u540d\u670d\u52a1Full GC\u95f4\u9694\u8f83\u77ed\uff08\u51e0\u4e2a\u5c0f\u65f6\u4e00\u6b21\uff09\uff0c\u800c\u6211\u7684\u670d\u52a1\u5e73\u5747\u95f4\u96942\u5468\u4e00\u6b21Full GC<\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288849\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288850\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>\u57fa\u4e8e\u4ee5\u4e0a\u63a8\u6d4b<\/p>\n<p>1\u3001 \u5b9e\u540d\u670d\u52a1\u7531\u4e8e GC \u95f4\u9694\u8f83\u77ed\uff0c\u5185\u5b58\u4e2d\u7684\u4e1c\u897f\u6839\u672c\u6ca1\u6709\u673a\u4f1a\u7f6e\u6362\u5230swap\u4e2d\u5c31\u88ab\u56de\u6536\u4e86\uff0cGC\u7684\u65f6\u5019\u4e0d\u9700\u8981\u5c06swap\u5206\u533a\u4e2d\u7684\u6570\u636e\u4ea4\u6362\u56de\u7269\u7406\u5185\u5b58\u4e2d\uff0c\u5b8c\u5168\u57fa\u4e8e\u5185\u5b58\u8ba1\u7b97\uff0c\u6240\u4ee5\u8981\u5feb\u5f88\u591a<\/p>\n<p>2\u3001 \u5c06\u54ea\u4e9b\u5185\u5b58\u6570\u636e\u7f6e\u6362\u8fdbswap\u4ea4\u6362\u533a\u7684\u7b5b\u9009\u7b56\u7565\u5e94\u8be5\u662f\u7c7b\u4f3c\u4e8eLRU\u7b97\u6cd5\uff08\u6700\u8fd1\u6700\u5c11\u4f7f\u7528\u539f\u5219\uff09<\/p>\n<p>\u4e3a\u4e86\u8bc1\u5b9e\u4e0a\u8ff0\u731c\u6d4b\uff0c\u6211\u4eec\u53ea\u9700\u8ddf\u8e2aswap\u53d8\u66f4\u65e5\u5fd7\uff0c\u76d1\u63a7\u6570\u636e\u53d8\u5316\u5373\u53ef\u5f97\u5230\u7b54\u6848\uff0c\u8fd9\u91cc\u91c7\u7528\u4e00\u6bb5shell \u811a\u672c\u5b9e\u73b0<\/p>\n<pre><code>#!\/bin\/bash \necho -e `date +%y%m%d%H%M%S` \necho -e &quot;PID\/t\/tSwap\/t\/tProc_Name&quot; \n\n#\u62ff\u51fa\/proc\u76ee\u5f55\u4e0b\u6240\u6709\u4ee5\u6570\u5b57\u4e3a\u540d\u7684\u76ee\u5f55\uff08\u8fdb\u7a0b\u540d\u662f\u6570\u5b57\u624d\u662f\u8fdb\u7a0b\uff0c\u5176\u4ed6\u5982sys,net\u7b49\u5b58\u653e\u7684\u662f\u5176\u4ed6\u4fe1\u606f\uff09 \nfor pid in `ls -l \/proc | grep ^d | awk '{ print $9 }'| grep -v [^0-9]` \ndo \n    if [ $pid -eq 1 ];then continue;fi \n    grep -q &quot;Swap&quot; \/proc\/$pid\/smaps 2&gt;\/dev\/null \n    if [ $? -eq 0 ];then \n        swap=$(gawk '\/Swap\/{ sum+=$2;} END{ print sum }' \/proc\/$pid\/smaps) #\u7edf\u8ba1\u5360\u7528\u7684swap\u5206\u533a\u7684 \u5927\u5c0f \u5355\u4f4d\u662fKB \n        proc_name=$(ps aux | grep -w &quot;$pid&quot; | awk '!\/grep\/{ for(i=11;i&lt;=NF;i++){ printf(&quot;%s &quot;,$i); }}') #\u53d6\u51fa\u8fdb\u7a0b\u7684\u540d\u5b57 \n        if [ $swap -gt 0 ];then #\u5224\u65ad\u662f\u5426\u5360\u7528swap \u53ea\u6709\u5360\u7528\u624d\u4f1a\u8f93\u51fa \n            echo -e &quot;${pid}\/t${swap}\/t${proc_name:0:100}&quot; \n    fi \n   fi\ndone | sort -k2nr | head -10 | gawk -F'\/t' '{ #\u6392\u5e8f\u53d6\u524d 10 \n    pid[NR]=$1; \n    size[NR]=$2; \n    name[NR]=$3; \n} \nEND{ \n    for(id=1;id&lt;=length(pid);id++) \n    { \n    if(size[id]&lt;1024) \n        printf(&quot;%-10s\/t%15sKB\/t%s\/n&quot;,pid[id],size[id],name[id]); \n    else if(size[id]&lt;1048576) \n        printf(&quot;%-10s\/t%15.2fMB\/t%s\/n&quot;,pid[id],size[id]\/1024,name[id]);\n    else \n    printf(&quot;%-10s\/t%15.2fGB\/t%s\/n&quot;,pid[id],size[id]\/1048576,name[id]); \n    } \n}'<\/code><\/pre>\n<p>\u7531\u4e8e\u4e0a\u9762\u56fe\u4e2d 2022.3.2 19:57:00 \u81f3 2022.3.2 19:58:00 \u53d1\u751f\u4e86\u4e00\u6b21Full GC\uff0c\u6211\u4eec\u91cd\u70b9\u5173\u6ce8\u4e0b\u8fd9\u4e00\u5206\u949f\u5185swap\u4ea4\u6362\u533a\u7684\u53d8\u5316\u5373\u53ef\uff0c\u6211\u8fd9\u91cc\u6bcf10s\u505a\u4e00\u6b21\u4fe1\u606f\u91c7\u96c6\uff0c\u53ef\u4ee5\u770b\u5230\u5728GC\u65f6\u70b9\u524d\u540e\uff0cswap\u786e\u5b9e\u6ca1\u6709\u53d8\u5316<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043288851\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<\/p>\n<p>\u901a\u8fc7\u4e0a\u8ff0\u5206\u6790\uff0c\u56de\u5f52\u672c\u6587\u6838\u5fc3\u95ee\u9898\u4e0a\uff0c\u73b0\u5728\u770b\u6765\u6211\u7684\u5904\u7406\u65b9\u5f0f\u8fc7\u4e8e\u6fc0\u8fdb\u4e86\uff0c\u5176\u5b9e\u4e5f\u53ef\u4ee5\u4e0d\u7528\u5173\u95edswap\uff0c\u901a\u8fc7\u9002\u5f53\u964d\u4f4e\u5806\u5927\u5c0f\uff0c\u4e5f\u662f\u80fd\u591f\u89e3\u51b3\u95ee\u9898\u7684\u3002<\/p>\n<p>\u8fd9\u4e5f\u4fa7\u9762\u7684\u8bf4\u660e\uff0c\u90e8\u7f72Java\u670d\u52a1\u7684Linux\u7cfb\u7edf\uff0c\u5728\u5185\u5b58\u5206\u914d\u4e0a\u5e76\u4e0d\u662f\u65e0\u8111\u5927\u800c\u5168\uff0c\u9700\u8981\u7efc\u5408\u8003\u8651\u4e0d\u540c\u573a\u666f\u4e0bJVM\u5bf9Java\u6c38\u4e45\u4ee3 \u3001Java\u5806(\u65b0\u751f\u4ee3\u548c\u8001\u5e74\u4ee3)\u3001\u7ebf\u7a0b\u6808\u3001Java NIO\u6240\u4f7f\u7528\u5185\u5b58\u7684\u9700\u6c42\u3002<\/p>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u7efc\u4e0a\uff0c\u6211\u4eec\u5f97\u51fa\u7ed3\u8bba\uff0cswap\u548cGC\u540c\u4e00\u65f6\u5019\u53d1\u751f\u4f1a\u5bfc\u81f4GC\u65f6\u95f4\u975e\u5e38\u957f\uff0cJVM\u4e25\u91cd\u5361\u987f\uff0c\u6781\u7aef\u7684\u60c5\u51b5\u4e0b\u4f1a\u5bfc\u81f4\u670d\u52a1\u5d29\u6e83\u3002<\/p>\n<p>\u4e3b\u8981\u539f\u56e0\u662f\uff1aJVM\u8fdb\u884cGC\u65f6\uff0c\u9700\u8981\u5bf9\u5bf9\u5e94\u5806\u5206\u533a\u7684\u5df2\u7528\u5185\u5b58\u8fdb\u884c\u904d\u5386\uff0c\u5047\u5982GC\u7684\u65f6\u5019\uff0c\u6709\u5806\u7684\u4e00\u90e8\u5206\u5185\u5bb9\u88ab\u4ea4\u6362\u5230swap\u4e2d\uff0c\u904d\u5386\u5230\u8fd9\u90e8\u5206\u7684\u65f6\u5019\u5c31\u987b\u8981\u5c06\u5176\u4ea4\u6362\u56de\u5185\u5b58\uff1b\u66f4\u6781\u7aef\u60c5\u51b5\u540c\u4e00\u65f6\u523b\u56e0\u4e3a\u5185\u5b58\u7a7a\u95f4\u4e0d\u8db3\uff0c\u5c31\u9700\u8981\u628a\u5185\u5b58\u4e2d\u5806\u7684\u53e6\u5916\u4e00\u90e8\u5206\u6362\u5230SWAP\u4e2d\u53bb\uff0c\u4e8e\u662f\u5728\u904d\u5386\u5806\u5206\u533a\u7684\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u628a\u6574\u4e2a\u5806\u5206\u533a\u8f6e\u6d41\u5f80SWAP\u5199\u4e00\u904d\uff0c\u5bfc\u81f4GC\u65f6\u95f4\u8d85\u957f\u3002\u7ebf\u4e0a\u5e94\u8be5\u9650\u5236swap\u533a\u7684\u5927\u5c0f\uff0c\u5982\u679cswap\u5360\u7528\u6bd4\u4f8b\u8f83\u9ad8\u5e94\u8be5\u8fdb\u884c\u6392\u67e5\u548c\u89e3\u51b3\uff0c\u9002\u5f53\u7684\u65f6\u5019\u53ef\u4ee5\u901a\u8fc7\u964d\u4f4e\u5806\u5927\u5c0f\uff0c\u6216\u8005\u6dfb\u52a0\u7269\u7406\u5185\u5b58\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u90e8\u7f72Java\u670d\u52a1\u7684Linux\u7cfb\u7edf\uff0c\u5728\u5185\u5b58\u5206\u914d\u4e0a\u8981\u614e\u91cd\u3002<\/p>\n<p>\u4ee5\u4e0a\u5185\u5bb9\u5e0c\u671b\u53ef\u4ee5\u8d77\u5230\u629b\u8f6c\u5f15\u7389\u7684\u4f5c\u7528\uff0c\u5982\u6709\u7406\u89e3\u4e0d\u5230\u4f4d\u7684\u5730\u65b9\u70e6\u8bf7\u6307\u51fa\u3002<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000043288825\">https:\/\/segmentfault.com\/a\/1190000043288825<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005\uff1a\u4eac\u4e1c\u79d1\u6280 \u5f90\u4f20\u4e50 \u80cc\u666f \u5728\u9ad8\u5e76\u53d1\u4e0b\uff0cJava\u7a0b\u5e8f\u7684GC\u95ee\u9898\u5c5e\u4e8e\u5f88\u5178\u578b\u7684\u4e00\u7c7b\u95ee\u9898\uff0c\u5e26\u6765\u7684\u5f71\u54cd\u5f80\u5f80\u4f1a\u88ab\u8fdb\u4e00\u6b65 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10007063","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10007063","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10007063"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10007063\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10007063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10007063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10007063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}