{"id":3623,"date":"2018-12-25T14:08:43","date_gmt":"2018-12-25T06:08:43","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=3623"},"modified":"2018-12-25T14:08:43","modified_gmt":"2018-12-25T06:08:43","slug":"%e4%b8%80%e4%b8%aa%e4%b8%8d%e5%86%8d%e8%a2%ab%e6%94%af%e6%8c%81%e7%9a%84%e5%91%bd%e4%bb%a4-jinfo-%e4%ba%86%e8%a7%a3%e4%b8%80%e4%b8%8b%ef%bc%81","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=3623","title":{"rendered":"\u4e00\u4e2a\u4e0d\u518d\u88ab\u652f\u6301\u7684\u547d\u4ee4 jinfo \u4e86\u89e3\u4e00\u4e0b\uff01"},"content":{"rendered":"<p>\n\t\u5728 java 8 \u4e2d jinfo \u547d\u4ee4\u63d0\u793a\u4e0d\u5728\u652f\u6301\u4e86\uff0c\u4f46\u662f\u8fd8\u53ef\u4ee5\u4f7f\u7528\u3002\u540e\u9762\u7684\u7248\u672c\u53ef\u80fd\u4f1a\u629b\u5f03\u5b83\u3002\u5efa\u8bae\u91c7\u7528 jps \u548c jsadebugd \u4e24\u4e2a\u547d\u4ee4\u53d6\u4ee3 jinfo \u547d\u4ee4\u3002\n<\/p>\n<p>\n\tjinfo \u662f java \u865a\u62df\u673a\u81ea\u5e26\u7684 Java \u914d\u7f6e\u4fe1\u606f\u5de5\u5177\u3002\n<\/p>\n<p>\n\tjinfo \u7684\u4f5c\u7528\u662f\u5b9e\u65f6\u5730\u67e5\u770b\u548c\u8c03\u6574\u865a\u62df\u673a\u7684\u5404\u9879\u53c2\u6570\uff0c\u4f7f\u7528 Jps \u547d\u4ee4\u7684 -v \u53c2\u6570\u53ef\u4ee5\u67e5\u770b\u865a\u62df\u673a\u542f\u52a8\u65f6\u663e\u793a\u6307\u5b9a\u7684\u53c2\u6570\u5217\u8868\u3002\n<\/p>\n<p>\n\t\u7528\u6cd5\u683c\u5f0f\u5982\u4e0b\uff1a\n<\/p>\n<pre class=\"brush:bash;\">\r\njinfo [ option ] pid\r\njinfo [ option ] executable core\r\njinfo [ option ] [server-id@]remote-hostname-or-IP<\/pre>\n<p>\n\t\u5404\u53c2\u6570\u89e3\u91ca\u5982\u4e0b\uff1a\n<\/p>\n<ul>\n<li>\n\t\tpid\uff1a\u8fdb\u7a0b\u53f7\n\t<\/li>\n<li>\n\t\texecutable\uff1a\u4ea7\u751fcore dump\u7684java executable\n\t<\/li>\n<li>\n\t\tcore\uff1acore file\n\t<\/li>\n<li>\n\t\tremote-hostname-or-IP\uff1a\u4e3b\u673a\u540d\u6216ip\n\t<\/li>\n<li>\n\t\tserver-id\uff1a\u8fdc\u7a0b\u4e3b\u673a\u4e0a\u7684debug server\u7684\u552f\u4e00id\n\t<\/li>\n<\/ul>\n<p>\n\tjinfo \u547d\u4ee4\u652f\u6301\u7684\u9009\u9879\u6709\u4e0b\u9762 4 \u79cd\uff1a\n<\/p>\n<ul>\n<li>\n\t\tno option\uff1a\u6253\u5370\u547d\u4ee4\u884c\u53c2\u6570\u548c\u7cfb\u7edf\u5c5e\u6027\n\t<\/li>\n<li>\n\t\t-flags\uff1a\u6253\u5370\u547d\u4ee4\u884c\u53c2\u6570\n\t<\/li>\n<li>\n\t\t-sysprops\uff1a\u6253\u5370\u7cfb\u7edf\u5c5e\u6027\n\t<\/li>\n<li>\n\t\t-h\uff1a\u5e2e\u52a9\n\t<\/li>\n<\/ul>\n<p>\n\t\u6267\u884c jinfo \u548c jinfo -help\u3001jinfo -h \u90fd\u5c06\u6253\u5370\u5e2e\u52a9\u4fe1\u606f\u3002\n<\/p>\n<p>\n\t\u5e38\u7528\u7684\u547d\u4ee4\u5982\u4e0b\uff1a\n<\/p>\n<pre class=\"brush:bash;\">\r\njinfo -sysprops 770\r\njinfo -flags 770\r\njinfo -flag +PrintGC 770\r\njinfo -flag +PrintGCDetails 770\r\njinfo -flag -PrintGC 770\r\njinfo -flag -PrintGCDetails 770\r\njinfo -flag PrintGC 770\r\njinfo -flag PrintGCDetails 770<\/pre>\n<p>\n\t\u5e38\u7528 JVM \u53c2\u6570\u5982\u4e0b\uff1a\n<\/p>\n<ul>\n<li>\n\t\t-Xms\uff1a\u521d\u59cb\u5806\u5927\u5c0f\uff0c\u9ed8\u8ba4\u4e3a\u7269\u7406\u5185\u5b58\u76841\/64(&lt;1GB)\uff1b\u9ed8\u8ba4(MinHeapFreeRatio\u53c2\u6570\u53ef\u4ee5\u8c03\u6574)\u7a7a\u4f59\u5806\u5185\u5b58\u5c0f\u4e8e40%\u65f6\uff0cJVM\u5c31\u4f1a\u589e\u5927\u5806\u76f4\u5230-Xmx\u7684\u6700\u5927\u9650\u5236\n\t<\/li>\n<li>\n\t\t-Xmx\uff1a\u6700\u5927\u5806\u5927\u5c0f\uff0c\u9ed8\u8ba4(MaxHeapFreeRatio\u53c2\u6570\u53ef\u4ee5\u8c03\u6574)\u7a7a\u4f59\u5806\u5185\u5b58\u5927\u4e8e70%\u65f6\uff0cJVM\u4f1a\u51cf\u5c11\u5806\u76f4\u5230 -Xms\u7684\u6700\u5c0f\u9650\u5236\n\t<\/li>\n<li>\n\t\t-Xmn\uff1a\u65b0\u751f\u4ee3\u7684\u5185\u5b58\u7a7a\u95f4\u5927\u5c0f\uff0c\u6ce8\u610f\uff1a\u6b64\u5904\u7684\u5927\u5c0f\u662f\uff08eden+ 2 survivor space)\u3002\u4e0ejmap -heap\u4e2d\u663e\u793a\u7684New gen\u662f\u4e0d\u540c\u7684\u3002\u6574\u4e2a\u5806\u5927\u5c0f=\u65b0\u751f\u4ee3\u5927\u5c0f + \u8001\u751f\u4ee3\u5927\u5c0f + \u6c38\u4e45\u4ee3\u5927\u5c0f\u3002\u5728\u4fdd\u8bc1\u5806\u5927\u5c0f\u4e0d\u53d8\u7684\u60c5\u51b5\u4e0b\uff0c\u589e\u5927\u65b0\u751f\u4ee3\u540e,\u5c06\u4f1a\u51cf\u5c0f\u8001\u751f\u4ee3\u5927\u5c0f\u3002\u6b64\u503c\u5bf9\u7cfb\u7edf\u6027\u80fd\u5f71\u54cd\u8f83\u5927,Sun\u5b98\u65b9\u63a8\u8350\u914d\u7f6e\u4e3a\u6574\u4e2a\u5806\u76843\/8\u3002\n\t<\/li>\n<li>\n\t\t-XX:SurvivorRatio\uff1a\u65b0\u751f\u4ee3\u4e2dEden\u533a\u57df\u4e0eSurvivor\u533a\u57df\u7684\u5bb9\u91cf\u6bd4\u503c\uff0c\u9ed8\u8ba4\u503c\u4e3a8\u3002\u4e24\u4e2aSurvivor\u533a\u4e0e\u4e00\u4e2aEden\u533a\u7684\u6bd4\u503c\u4e3a2:8,\u4e00\u4e2aSurvivor\u533a\u5360\u6574\u4e2a\u5e74\u8f7b\u4ee3\u76841\/10\u3002\n\t<\/li>\n<li>\n\t\t-Xss\uff1a\u6bcf\u4e2a\u7ebf\u7a0b\u7684\u5806\u6808\u5927\u5c0f\u3002JDK5.0\u4ee5\u540e\u6bcf\u4e2a\u7ebf\u7a0b\u5806\u6808\u5927\u5c0f\u4e3a1M,\u4ee5\u524d\u6bcf\u4e2a\u7ebf\u7a0b\u5806\u6808\u5927\u5c0f\u4e3a256K\u3002\u5e94\u6839\u636e\u5e94\u7528\u7684\u7ebf\u7a0b\u6240\u9700\u5185\u5b58\u5927\u5c0f\u8fdb\u884c\u9002\u5f53\u8c03\u6574\u3002\u5728\u76f8\u540c\u7269\u7406\u5185\u5b58\u4e0b,\u51cf\u5c0f\u8fd9\u4e2a\u503c\u80fd\u751f\u6210\u66f4\u591a\u7684\u7ebf\u7a0b\u3002\u4f46\u662f\u64cd\u4f5c\u7cfb\u7edf\u5bf9\u4e00\u4e2a\u8fdb\u7a0b\u5185\u7684\u7ebf\u7a0b\u6570\u8fd8\u662f\u6709\u9650\u5236\u7684\uff0c\u4e0d\u80fd\u65e0\u9650\u751f\u6210\uff0c\u7ecf\u9a8c\u503c\u57283000~5000\u5de6\u53f3\u3002\u4e00\u822c\u5c0f\u7684\u5e94\u7528\uff0c \u5982\u679c\u6808\u4e0d\u662f\u5f88\u6df1\uff0c \u5e94\u8be5\u662f128k\u591f\u7528\u7684\uff0c\u5927\u7684\u5e94\u7528\u5efa\u8bae\u4f7f\u7528256k\u3002\u8fd9\u4e2a\u9009\u9879\u5bf9\u6027\u80fd\u5f71\u54cd\u6bd4\u8f83\u5927\uff0c\u9700\u8981\u4e25\u683c\u7684\u6d4b\u8bd5\u3002\u548cthreadstacksize\u9009\u9879\u89e3\u91ca\u5f88\u7c7b\u4f3c,\u5b98\u65b9\u6587\u6863\u4f3c\u4e4e\u6ca1\u6709\u89e3\u91ca,\u5728\u8bba\u575b\u4e2d\u6709\u8fd9\u6837\u4e00\u53e5\u8bdd:&quot;-Xss is translated in a VM flag named ThreadStackSize&rdquo;\u4e00\u822c\u8bbe\u7f6e\u8fd9\u4e2a\u503c\u5c31\u53ef\u4ee5\u4e86\u3002\n\t<\/li>\n<li>\n\t\t-XX:PermSize\uff1a\u8bbe\u7f6e\u6c38\u4e45\u4ee3(perm gen)\u521d\u59cb\u503c\u3002\u9ed8\u8ba4\u503c\u4e3a\u7269\u7406\u5185\u5b58\u76841\/64\u3002\n\t<\/li>\n<li>\n\t\t-XX:MaxPermSize\uff1a\u8bbe\u7f6e\u6301\u4e45\u4ee3\u6700\u5927\u503c\u3002\u7269\u7406\u5185\u5b58\u76841\/4\u3002\n\t<\/li>\n<\/ul>\n<p>\n\t\u8fd9\u4e9b\u53c2\u6570\u90fd\u53ef\u4ee5\u901a\u8fc7&nbsp;java -XX:+PrintFlagsFinal -version | grep manageable \u547d\u4ee4\u83b7\u53d6\u5230\u3002\n<\/p>\n<pre class=\"brush:bash;\">\r\njava -XX:+PrintFlagsFinal -version | grep manageable<\/pre>\n<pre class=\"brush:bash;\">\r\n~ java -XX:+PrintFlagsFinal -version | grep manageable\r\n     intx CMSAbortablePrecleanWaitMillis            = 100                                 {manageable}\r\n     intx CMSTriggerInterval                        = -1                                  {manageable}\r\n     intx CMSWaitDuration                           = 2000                                {manageable}\r\n     bool HeapDumpAfterFullGC                       = false                               {manageable}\r\n     bool HeapDumpBeforeFullGC                      = false                               {manageable}\r\n     bool HeapDumpOnOutOfMemoryError                = false                               {manageable}\r\n    ccstr HeapDumpPath                              =                                     {manageable}\r\n    uintx MaxHeapFreeRatio                          = 100                                 {manageable}\r\n    uintx MinHeapFreeRatio                          = 0                                   {manageable}\r\n     bool PrintClassHistogram                       = false                               {manageable}\r\n     bool PrintClassHistogramAfterFullGC            = false                               {manageable}\r\n     bool PrintClassHistogramBeforeFullGC           = false                               {manageable}\r\n     bool PrintConcurrentLocks                      = false                               {manageable}\r\n     bool PrintGC                                   = false                               {manageable}\r\n     bool PrintGCDateStamps                         = false                               {manageable}\r\n     bool PrintGCDetails                            = false                               {manageable}\r\n     bool PrintGCID                                 = false                               {manageable}\r\n     bool PrintGCTimeStamps                         = false                               {manageable}\r\njava version &quot;1.8.0_181&quot;\r\nJava(TM) SE Runtime Environment (build 1.8.0_181-b13)\r\nJava HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)<\/pre>\n<h2>\n\t\u53c2\u8003\u8d44\u6599<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t<a href=\"https:\/\/docs.oracle.com\/javase\/8\/docs\/technotes\/tools\/unix\/jinfo.html\" name=\"jinfo\" target=\"_blank\" title=\"jinfo\">jinfo<\/a>\n\t<\/li>\n<\/ul>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=3623\">\u4e00\u4e2a\u4e0d\u518d\u88ab\u652f\u6301\u7684\u547d\u4ee4 jinfo \u4e86\u89e3\u4e00\u4e0b\uff01<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u5728 java 8 \u4e2d jinfo \u547d\u4ee4\u63d0\u793a\u4e0d\u5728\u652f\u6301\u4e86\uff0c\u4f46\u662f\u8fd8\u53ef\u4ee5\u4f7f\u7528\u3002\u540e\u9762\u7684\u7248\u672c\u53ef\u80fd\u4f1a\u629b\u5f03\u5b83\u3002\u5efa\u8bae\u91c7\u7528 jps [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1848,1850,1846,1844,945],"class_list":["post-3623","post","type-post","status-publish","format-standard","hentry","category-java","tag-jhat","tag-jinfo","tag-jmap","tag-jps","tag-jstack"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3623"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3623\/revisions"}],"predecessor-version":[{"id":3624,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3623\/revisions\/3624"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}