{"id":393,"date":"2023-06-18T15:05:58","date_gmt":"2023-06-18T07:05:58","guid":{"rendered":"https:\/\/www.gzlcy.cn\/?p=393"},"modified":"2023-06-18T15:05:58","modified_gmt":"2023-06-18T07:05:58","slug":"%e4%bd%bf%e7%94%a8-logcat-%e5%86%99%e5%85%a5%e5%92%8c%e6%9f%a5%e7%9c%8b%e6%97%a5%e5%bf%97","status":"publish","type":"post","link":"http:\/\/www.gzlcy.cn\/?p=393","title":{"rendered":"\u4f7f\u7528 Logcat \u5199\u5165\u548c\u67e5\u770b\u65e5\u5fd7"},"content":{"rendered":"<p>Android Studio \u4e2d\u7684 Logcat \u7a97\u53e3\u4f1a\u663e\u793a\u7cfb\u7edf\u6d88\u606f\uff0c\u4f8b\u5982\u5728\u8fdb\u884c\u5783\u573e\u56de\u6536\u65f6\u663e\u793a\u7684\u6d88\u606f\uff0c\u4ee5\u53ca\u4f7f\u7528 Log \u7c7b\u6dfb\u52a0\u5230\u5e94\u7528\u7684\u6d88\u606f\u3002Logcat \u53ef\u4ee5\u5b9e\u65f6\u663e\u793a\u6d88\u606f\uff0c\u4e5f\u53ef\u4ee5\u4fdd\u7559\u5386\u53f2\u8bb0\u5f55\uff0c\u56e0\u6b64\u60a8\u53ef\u4ee5\u67e5\u770b\u8f83\u65e9\u7684\u6d88\u606f\u3002<\/p>\n<p>\u8981\u4ec5\u663e\u793a\u611f\u5174\u8da3\u7684\u4fe1\u606f\uff0c\u60a8\u53ef\u4ee5\u521b\u5efa\u8fc7\u6ee4\u5668\u3001\u4fee\u6539\u6d88\u606f\u4e2d\u663e\u793a\u7684\u4fe1\u606f\u91cf\u3001\u8bbe\u7f6e\u4f18\u5148\u7ea7\u3001\u4ec5\u663e\u793a\u901a\u8fc7\u5e94\u7528\u4ee3\u7801\u751f\u6210\u7684\u6d88\u606f\u4ee5\u53ca\u641c\u7d22\u65e5\u5fd7\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cLogcat \u4ec5\u663e\u793a\u4e0e\u6700\u8fd1\u8fd0\u884c\u7684\u5e94\u7528\u76f8\u5173\u7684\u65e5\u5fd7\u8f93\u51fa\u3002<\/p>\n<p>\u5982\u679c\u5e94\u7528\u629b\u51fa\u5f02\u5e38\uff0cLogcat \u4f1a\u663e\u793a\u4e00\u6761\u6d88\u606f\uff0c\u540e\u8ddf\u76f8\u5173\u8054\u7684\u5806\u6808\u8f68\u8ff9\uff0c\u5176\u4e2d\u5305\u542b\u6307\u5411\u76f8\u5e94\u4ee3\u7801\u884c\u7684\u94fe\u63a5\u3002<\/p>\n<p>\u8fd0\u884c\u7a97\u53e3\u4f1a\u663e\u793a\u5f53\u524d\u8fd0\u884c\u7684\u5e94\u7528\u7684\u65e5\u5fd7\u6d88\u606f\u3002\u60a8\u53ef\u4ee5\u914d\u7f6e Logcat \u8f93\u51fa\u663e\u793a\uff0c\u4f46\u65e0\u6cd5\u914d\u7f6e\u8fd0\u884c\u7a97\u53e3\u3002<\/p>\n<p>\u67e5\u770b\u5e94\u7528\u65e5\u5fd7<\/p>\n<p>\u5982\u9700\u663e\u793a\u5e94\u7528\u7684\u65e5\u5fd7\u6d88\u606f\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a<\/p>\n<p>\u5728\u8bbe\u5907\u4e0a\u3002    \u4f9d\u6b21\u70b9\u51fb View &gt; Tool Windows &gt; Logcat\uff0c\u6216\u70b9\u51fb\u5de5\u5177\u7a97\u53e3\u680f\u4e2d\u7684 Logcat \u56fe\u6807<\/p>\n<p><img src='https:\/\/developer.android.google.cn\/static\/studio\/images\/buttons\/logcat-icon.png?hl=zh-cn' alt='1' \/><\/p>\n<p>\u3002<\/p>\n<p>Logcat \u7a97\u53e3\u4f1a\u663e\u793a\u4ece\u7a97\u53e3\u9876\u90e8\u83dc\u5355\u4e2d\u9009\u62e9\u7684\u5e94\u7528\u7684\u65e5\u5fd7\u6d88\u606f\uff0c\u5982\u56fe 1 \u6240\u793a\u3002<\/p>\n<p><img src='https:\/\/developer.android.google.cn\/static\/studio\/images\/debug\/logcat_2x.png?hl=zh-cn' alt='1' \/><\/p>\n<p>\u56fe 1. Logcat \u7a97\u53e3\u3002<\/p>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cLogcat \u4ec5\u663e\u793a\u5728\u8bbe\u5907\u4e0a\u8fd0\u884c\u7684\u5e94\u7528\u7684\u65e5\u5fd7\u6d88\u606f\u3002\u82e5\u8981\u66f4\u6539\u6b64\u9ed8\u8ba4\u8bbe\u7f6e\uff0c\u8bf7\u53c2\u9605\u5982\u4f55\u3002<\/p>\n<p>Logcat \u5de5\u5177\u680f\u4e2d\u63d0\u4f9b\u4ee5\u4e0b\u6309\u94ae\uff1a<\/p>\n<p>Clear Logcat<\/p>\n<p><img src='https:\/\/developer.android.google.cn\/static\/studio\/images\/buttons\/logcat-clear.png?hl=zh-cn' alt='1' \/><\/p>\n<p>\uff1a\u70b9\u51fb\u6b64\u6309\u94ae\u53ef\u4ee5\u6e05\u9664\u663e\u793a\u7684\u65e5\u5fd7\u3002  Scroll to the end<\/p>\n<p><img src='https:\/\/developer.android.google.cn\/static\/studio\/images\/buttons\/logcat-scroll-end.png?hl=zh-cn' alt='1' \/><\/p>\n<p>\uff1a\u70b9\u51fb\u6b64\u6309\u94ae\u53ef\u4ee5\u8df3\u8f6c\u5230\u65e5\u5fd7\u5e95\u90e8\u5e76\u67e5\u770b\u6700\u65b0\u7684\u65e5\u5fd7\u6d88\u606f\u3002\u5982\u679c\u60a8\u5148\u70b9\u51fb\u6b64\u6309\u94ae\uff0c\u7136\u540e\u70b9\u51fb\u65e5\u5fd7\u4e2d\u7684\u67d0\u4e00\u884c\uff0c\u5219\u89c6\u56fe\u4f1a\u5728\u76f8\u5e94\u4f4d\u7f6e\u6682\u505c\u6eda\u52a8\u3002  Up the stack trace<\/p>\n<p><img src='https:\/\/developer.android.google.cn\/static\/studio\/images\/buttons\/logcat-trace-up.png?hl=zh-cn' alt='1' \/><\/p>\n<p>\u548c Down the stack trace<\/p>\n<p><img src='https:\/\/developer.android.google.cn\/static\/studio\/images\/buttons\/logcat-trace-down.png?hl=zh-cn' alt='1' \/><\/p>\n<p>\uff1a  \u70b9\u51fb\u76f8\u5e94\u6309\u94ae\u53ef\u4ee5\u5728\u65e5\u5fd7\u7684\u5806\u6808\u8f68\u8ff9\u4e2d\u8fdb\u884c\u4e0a\u4e0b\u5bfc\u822a\uff0c\u4ece\u800c\u9009\u62e9\u8f93\u51fa\u7684\u5f02\u5e38\u4e2d\u663e\u793a\u7684\u4e0a\u4e00\u4e2a\u6216\u4e0b\u4e00\u4e2a\u6587\u4ef6\u540d\u3002\u8fd9\u4e0e\u60a8\u5728\u65e5\u5fd7\u4e2d\u70b9\u51fb\u67d0\u4e2a\u6587\u4ef6\u540d\u65f6\u7684\u884c\u4e3a\u76f8\u540c\u3002  Use soft wraps<\/p>\n<p><img src='https:\/\/developer.android.google.cn\/static\/studio\/images\/buttons\/logcat-wrap.png?hl=zh-cn' alt='1' \/><\/p>\n<p>\uff1a\u70b9\u51fb\u6b64\u6309\u94ae\u53ef\u4ee5\u542f\u7528\u6362\u884c\u5e76\u9632\u6b62\u6c34\u5e73\u6eda\u52a8\u3002\u4e0d\u8fc7\uff0c\u6240\u6709\u975e\u95f4\u65ad\u5b57\u7b26\u4e32\u4ecd\u7136\u9700\u8981\u8fdb\u884c\u6c34\u5e73\u6eda\u52a8\u3002  Print<\/p>\n<p><img src='https:\/\/developer.android.google.cn\/static\/studio\/images\/buttons\/logcat-print.png?hl=zh-cn' alt='1' \/><\/p>\n<p>\uff1a\u70b9\u51fb\u6b64\u6309\u94ae\u53ef\u4ee5\u8f93\u51fa Logcat \u6d88\u606f\u3002\u5728\u663e\u793a\u7684\u5bf9\u8bdd\u6846\u4e2d\u9009\u62e9\u8f93\u51fa\u504f\u597d\u8bbe\u7f6e\u540e\uff0c\u60a8\u8fd8\u53ef\u4ee5\u9009\u62e9\u5c06\u6d88\u606f\u4fdd\u5b58\u4e3a PDF \u683c\u5f0f\u3002  Restart<\/p>\n<p><img src='https:\/\/developer.android.google.cn\/static\/studio\/images\/buttons\/logcat-restart.png?hl=zh-cn' alt='1' \/><\/p>\n<p>\uff1a\u70b9\u51fb\u6b64\u6309\u94ae\u53ef\u4ee5\u6e05\u9664\u65e5\u5fd7\u5e76\u91cd\u542f Logcat\u3002\u4e0e Clear Logcat \u6309\u94ae\u4e0d\u540c\uff0c\u6b64\u6309\u94ae\u53ef\u4ee5\u6062\u590d\u5e76\u663e\u793a\u4e4b\u524d\u7684\u65e5\u5fd7\u6d88\u606f\uff0c\u56e0\u6b64\u5f53 Logcat \u65e0\u54cd\u5e94\u800c\u60a8\u53c8\u4e0d\u60f3\u5931\u53bb\u65e5\u5fd7\u6d88\u606f\u65f6\uff0c\u6b64\u6309\u94ae\u662f\u6700\u6709\u7528\u7684\u3002  Logcat header<\/p>\n<p><img src='https:\/\/developer.android.google.cn\/static\/studio\/images\/buttons\/logcat-headers.png?hl=zh-cn' alt='1' \/><\/p>\n<p>\uff1a\u70b9\u51fb\u6b64\u6309\u94ae\u53ef\u4ee5\u6253\u5f00 Configure Logcat Header \u5bf9\u8bdd\u6846\uff0c\u5728\u8be5\u5bf9\u8bdd\u6846\u4e2d\uff0c\u60a8\u53ef\u4ee5\u81ea\u5b9a\u4e49\u5404\u4e2a Logcat \u6d88\u606f\u7684\u5916\u89c2\uff0c\u4f8b\u5982\u662f\u5426\u663e\u793a\u65e5\u671f\u548c\u65f6\u95f4\u3002  Screen capture<\/p>\n<p><img src='https:\/\/developer.android.google.cn\/static\/studio\/images\/buttons\/monitor-screenshot.png?hl=zh-cn' alt='1' \/><\/p>\n<p>\uff1a\u70b9\u51fb\u6b64\u6309\u94ae\u53ef\u4ee5\u622a\u53d6\u5c4f\u5e55\u622a\u56fe\u3002  Screen record<\/p>\n<p><img src='https:\/\/developer.android.google.cn\/static\/studio\/images\/buttons\/logcat-record.png?hl=zh-cn' alt='1' \/><\/p>\n<p>\uff1a\u70b9\u51fb\u6b64\u6309\u94ae\u53ef\u4ee5\u5f55\u5236\u8bbe\u5907\u5c4f\u5e55\u7684\u89c6\u9891\uff08\u65f6\u957f\u4e0d\u8d85\u8fc7 3 \u5206\u949f\uff09\u3002\u5199\u5165\u65e5\u5fd7\u6d88\u606f<\/p>\n<p>\u901a\u8fc7 Log \u7c7b\uff0c\u60a8\u53ef\u4ee5\u521b\u5efa\u65e5\u5fd7\u6d88\u606f\uff0c\u8fd9\u4e9b\u6d88\u606f\u4f1a\u663e\u793a\u5728 Logcat \u4e2d\u3002\u6bcf\u4e2a Android \u65e5\u5fd7\u6d88\u606f\u90fd\u6709\u4e00\u4e2a\u4e0e\u4e4b\u76f8\u5173\u8054\u7684\u6807\u8bb0\u548c\u4f18\u5148\u7ea7\u3002\u7cfb\u7edf\u65e5\u5fd7\u6d88\u606f\u7684\u6807\u8bb0\u662f\u4e00\u4e2a\u7b80\u77ed\u7684\u5b57\u7b26\u4e32\uff0c\u6307\u793a\u6d88\u606f\u6240\u6e90\u81ea\u7684\u7cfb\u7edf\u7ec4\u4ef6\u3002<\/p>\n<p>\u5e94\u4f7f\u7528\u4ee5\u4e0b\u65e5\u5fd7\u65b9\u6cd5\uff0c\u8fd9\u4e9b\u65b9\u6cd5\u6309\u7167\u4f18\u5148\u7ea7\u4ece\u9ad8\u5230\u4f4e\u7684\u987a\u5e8f\u5217\u793a\uff1a<\/p>\n<p>\u7528\u6237\u5b9a\u4e49\u7684\u6807\u8bb0\u53ef\u4ee5\u662f\u60a8\u8ba4\u4e3a\u6709\u7528\u7684\u4efb\u4f55\u5b57\u7b26\u4e32\uff0c\u4f8b\u5982\u5f53\u524d\u7c7b\u7684\u540d\u79f0\u3002\u60a8\u53ef\u4ee5\u5728 Log \u65b9\u6cd5\u8c03\u7528\u4e2d\u5b9a\u4e49\u6807\u8bb0\uff0c\u4f8b\u5982\uff1a<\/p>\n<p>Kotlin<\/p>\n<p><pre class=\"prettyprint lang-kotlin\" dir=\"ltr\">\nLog.d(tag, message)\n<\/pre>\n<\/p>\n<p>Java<\/p>\n<p><pre class=\"prettyprint lang-java\" dir=\"ltr\">\nLog.d(tag, message);\n<\/pre>\n<\/p>\n<p>\u6709\u5173\u66f4\u5b8c\u6574\u7684\u9009\u9879\u5217\u8868\uff0c\u8bf7\u53c2\u9605 Log \u7c7b\u8bf4\u660e\u3002<\/p>\n<p>\u9664\u5f00\u53d1\u671f\u95f4\u5916\uff0c\u5176\u4ed6\u4efb\u4f55\u65f6\u5019\u90fd\u7edd\u4e0d\u5e94\u5c06\u8be6\u7ec6\u65e5\u5fd7\u8bb0\u5f55\u7f16\u8bd1\u5230\u60a8\u7684\u5e94\u7528\u4e2d\u3002\u8c03\u8bd5\u65e5\u5fd7\u4f1a\u88ab\u7f16\u8bd1\uff0c\u4f46\u5728\u8fd0\u884c\u65f6\u4f1a\u88ab\u5220\u9664\u3002\u9519\u8bef\u3001\u8b66\u544a\u548c\u4fe1\u606f\u65e5\u5fd7\u4f1a\u59cb\u7ec8\u4fdd\u7559\u3002<\/p>\n<p>\u5bf9\u4e8e\u6bcf\u79cd\u65e5\u5fd7\u65b9\u6cd5\uff0c\u7b2c\u4e00\u4e2a\u53c2\u6570\u90fd\u5e94\u662f\u552f\u4e00\u6807\u8bb0\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u90fd\u5e94\u662f\u6d88\u606f\u3002\u7cfb\u7edf\u65e5\u5fd7\u6d88\u606f\u7684\u6807\u8bb0\u662f\u4e00\u4e2a\u7b80\u77ed\u7684\u5b57\u7b26\u4e32\uff0c\u6307\u793a\u6d88\u606f\u6240\u6e90\u81ea\u7684\u7cfb\u7edf\u7ec4\u4ef6\u3002\u6807\u8bb0\u53ef\u4ee5\u662f\u60a8\u8ba4\u4e3a\u6709\u7528\u7684\u4efb\u4f55\u5b57\u7b26\u4e32\uff0c\u4f8b\u5982\u5f53\u524d\u7c7b\u7684\u540d\u79f0\u3002<\/p>\n<p>\u4e00\u79cd\u6bd4\u8f83\u597d\u7684\u505a\u6cd5\u662f\uff0c\u5728\u8981\u7528\u4e8e\u7b2c\u4e00\u4e2a\u53c2\u6570\u7684\u7c7b\u4e2d\u58f0\u660e TAG \u5e38\u91cf\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u6309\u5982\u4e0b\u65b9\u5f0f\u521b\u5efa\u4e00\u6761\u4fe1\u606f\u65e5\u5fd7\u6d88\u606f\uff1a<\/p>\n<p>Kotlin<\/p>\n<p><pre class=\"prettyprint lang-kotlin\" dir=\"ltr\">\nprivate const val TAG = \"MyActivity\"\n...\nLog.i(TAG, \"MyClass.getView() \u2014 get item number $position\")\n<\/pre>\n<\/p>\n<p>Java<\/p>\n<p><pre class=\"prettyprint lang-java\" dir=\"ltr\">\nprivate static final String TAG = \"MyActivity\";\n...\nLog.i(TAG, \"MyClass.getView() \u2014 get item number \" + position);\n<\/pre>\n<\/p>\n<p>\u6ce8\u610f\uff1a\u957f\u5ea6\u8d85\u8fc7 23 \u4e2a\u5b57\u7b26\u7684\u6807\u8bb0\u540d\u79f0\u5728 Logcat \u8f93\u51fa\u4e2d\u4f1a\u88ab\u622a\u65ad\u3002<\/p>\n<p>Logcat \u6d88\u606f\u683c\u5f0f<\/p>\n<p>\u65e5\u5fd7\u6d88\u606f\u7684\u683c\u5f0f\u4e3a\uff1a<\/p>\n<p><pre class=\"none\" dir=\"ltr\">\n<em><var>date<\/var> <var>time<\/var> <var>PID<\/var>-<var>TID<\/var>\/<var>package<\/var>\n<var>priority<\/var>\/<var>tag<\/var>: <var>message<\/var><\/em>\n<\/pre>\n<\/p>\n<p>PID \u4ee3\u8868\u201c\u8fdb\u7a0b\u6807\u8bc6\u7b26\u201d\uff0cTID \u5219\u4e3a\u201c\u7ebf\u7a0b\u6807\u8bc6\u7b26\u201d\u3002\u5982\u679c\u4ec5\u6709\u4e00\u4e2a\u7ebf\u7a0b\uff0c\u4e24\u8005\u53ef\u4ee5\u76f8\u540c\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u4e0b\u9762\u7684\u65e5\u5fd7\u6d88\u606f\u7684\u4f18\u5148\u7ea7\u4e3a V\uff0c\u6807\u8bb0\u4e3a AuthZen\uff1a<\/p>\n<p><pre class=\"none\" dir=\"ltr\">\n12-10 13:02:50.071 1901-4229\/com.google.android.gms V\/AuthZen: Handling delegate intent.\n<\/pre>\n<\/p>\n<p>\u8bbe\u7f6e\u65e5\u5fd7\u7ea7\u522b<\/p>\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u65e5\u5fd7\u7ea7\u522b\u6765\u63a7\u5236 Logcat \u4e2d\u663e\u793a\u6240\u6709\u6d88\u606f\uff0c\u8fd8\u662f\u4ec5\u663e\u793a\u6307\u793a\u6700\u4e25\u91cd\u60c5\u51b5\u7684\u6d88\u606f\u3002<\/p>\n<p>\u65e0\u8bba\u65e5\u5fd7\u7ea7\u522b\u8bbe\u7f6e\u5982\u4f55\uff0cLogcat \u90fd\u4f1a\u7ee7\u7eed\u6536\u96c6\u6240\u6709\u6d88\u606f\u3002\u6b64\u8bbe\u7f6e\u4ec5\u51b3\u5b9a Logcat \u663e\u793a\u4ec0\u4e48\u3002<\/p>\n<p>\u5728 Log level \u83dc\u5355\u4e2d\uff0c\u9009\u62e9\u4ee5\u4e0b\u503c\u4e4b\u4e00\uff1a<\/p>\n<p>\u641c\u7d22 Logcat \u6d88\u606f<\/p>\n<p>\u82e5\u8981\u641c\u7d22 Logcat \u4e2d\u5f53\u524d\u663e\u793a\u7684\u6d88\u606f\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a<\/p>\n<p>\uff08\u53ef\u9009\uff09\u5982\u679c\u60a8\u60f3\u8981\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u641c\u7d22\u6a21\u5f0f\uff0c\u8bf7\u9009\u62e9 Regex\u3002    \u5728\u641c\u7d22\u5b57\u6bb5<\/p>\n<p><img src='https:\/\/developer.android.google.cn\/static\/images\/tools\/am-isearch.png?hl=zh-cn' alt='1' \/><\/p>\n<p>\u4e2d\u8f93\u5165\u5b57\u7b26\u5e8f\u5217\u3002<\/p>\n<p>Logcat \u8f93\u51fa\u4f1a\u76f8\u5e94\u5730\u663e\u793a\u66f4\u6539\u3002<\/p>\n<p>\u6309 Enter \u952e\u4ee5\u5728\u6b64\u4f1a\u8bdd\u671f\u95f4\u5c06\u641c\u7d22\u5b57\u7b26\u4e32\u4fdd\u5b58\u5230\u83dc\u5355\u4e2d\u3002    \u82e5\u8981\u91cd\u590d\u641c\u7d22\uff0c\u8bf7\u4ece\u641c\u7d22\u83dc\u5355\u4e2d\u9009\u62e9\u3002\u6839\u636e\u9700\u8981\u9009\u62e9\u6216\u53d6\u6d88\u9009\u62e9 Regex\u3002  \u8fc7\u6ee4 Logcat \u6d88\u606f<\/p>\n<p>\u5c06\u65e5\u5fd7\u8f93\u51fa\u51cf\u5c11\u81f3\u53ef\u7ba1\u7406\u6c34\u5e73\u7684\u4e00\u79cd\u65b9\u6cd5\u662f\uff0c\u4f7f\u7528\u8fc7\u6ee4\u5668\u65bd\u52a0\u9650\u5236\u3002<\/p>\n<p>\u6ce8\u610f\uff1a\u8fc7\u6ee4\u5668\u4f1a\u5e94\u7528\u4e8e Logcat \u7684\u5168\u90e8\u5386\u53f2\u8bb0\u5f55\uff0c\u800c\u4e0d\u4ec5\u4ec5\u662f Logcat \u4e2d\u5f53\u524d\u663e\u793a\u7684\u6d88\u606f\u3002\u786e\u4fdd\u9002\u5f53\u5730\u8bbe\u7f6e\u5176\u4ed6\u663e\u793a\u9009\u9879\uff0c\u4ee5\u4fbf\u60a8\u80fd\u591f\u770b\u5230\u60f3\u8981\u68c0\u67e5\u7684\u8fc7\u6ee4\u5668\u8f93\u51fa\u3002<\/p>\n<p>\u82e5\u8981\u5b9a\u4e49\u5e76\u5e94\u7528\u8fc7\u6ee4\u5668\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a<\/p>\n<p>\u5728\u8fc7\u6ee4\u5668\u83dc\u5355\u4e2d\uff0c\u9009\u62e9\u4e00\u4e2a\u8fc7\u6ee4\u9009\u9879\uff1a<\/p>\n<p>\u5b9a\u4e49\u8fc7\u6ee4\u5668\u540e\uff0c\u60a8\u8fd8\u53ef\u4ee5\u5728\u83dc\u5355\u4e2d\u9009\u62e9\u5b83\u4eec\u3002\u82e5\u8981\u4ece\u83dc\u5355\u4e2d\u79fb\u9664\u8fc7\u6ee4\u5668\uff0c\u5220\u9664\u5b83\u4eec\u5373\u53ef\u3002<\/p>\n<p>\u5982\u679c\u60a8\u9009\u62e9\u4e86 Edit Filter Configuration\uff0c\u8bf7\u521b\u5efa\u6216\u4fee\u6539\u8fc7\u6ee4\u5668\uff1a\u5728\u201cCreate New Logcat Filter\u201d\u5bf9\u8bdd\u6846\u4e2d\u6307\u5b9a\u8fc7\u6ee4\u5668\u53c2\u6570\uff1a\u70b9\u51fb +\uff0c\u5c06\u8fc7\u6ee4\u5668\u5b9a\u4e49\u6dfb\u52a0\u5230\u5de6\u4fa7\u7a97\u683c\u4e2d\u3002<\/p>\n<p>\u82e5\u8981\u79fb\u9664\u8fc7\u6ee4\u5668\uff0c\u8bf7\u5728\u5de6\u4fa7\u7a97\u683c\u4e2d\u5c06\u5176\u9009\u4e2d\uff0c\u7136\u540e\u70b9\u51fb -\u3002<\/p>\n<p>\u5b8c\u6210\u540e\uff0c\u70b9\u51fb OK\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6ca1\u6709\u770b\u5230\u6240\u9700\u7684\u65e5\u5fd7\u6d88\u606f\uff0c\u8bf7\u9009\u62e9 No filters \u5e76\u7279\u5b9a\u65e5\u5fd7\u6d88\u606f\u3002<\/p>\n<p>\u8bfb\u53d6\u5783\u573e\u56de\u6536\u6d88\u606f<\/p>\n<p>\u6709\u65f6\uff0c\u53d1\u751f\u5783\u573e\u56de\u6536 (GC) \u4e8b\u4ef6\u65f6\uff0c\u76f8\u5e94\u6d88\u606f\u4f1a\u8f93\u51fa\u5230 Logcat \u4e2d\u3002<\/p>\n<p>\u5982\u9700\u8be6\u7ec6\u4e86\u89e3\u5e94\u7528\u7684\u5185\u5b58\uff0c\u8bf7\u4f7f\u7528\u5185\u5b58\u5206\u6790\u5668\u3002<\/p>\n<p>Dalvik \u65e5\u5fd7\u6d88\u606f<\/p>\n<p>\u5728 Dalvik\uff08\u800c\u4e0d\u662f ART\uff09\u4e2d\uff0c\u6bcf\u4e2a GC \u90fd\u4f1a\u5c06\u4ee5\u4e0b\u4fe1\u606f\u8f93\u51fa\u5230 Logcat \u4e2d\uff1a<\/p>\n<p><pre class=\"none\" dir=\"ltr\">\nD\/dalvikvm(<var>PID<\/var>): <var>GC_Reason<\/var> <var>Amount_freed<\/var>,\n<var>Heap_stats<\/var>, <var>External_memory_stats<\/var>, <var>Pause_time<\/var>\n<\/pre>\n<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<p><pre class=\"none\" dir=\"ltr\">\nD\/dalvikvm( 9050): GC_CONCURRENT freed 2049K, 65% free 3571K\/9991K, external 4703K\/5261K, paused 2ms+2ms\n<\/pre>\n<\/p>\n<p>\u5728\u65e5\u5fd7\u6d88\u606f\u79ef\u805a\u65f6\uff0c\u8bf7\u6ce8\u610f\u5806\u7edf\u8ba1\u6570\u636e\u7684\u589e\u5927\u60c5\u51b5\u3002\u5982\u679c\u6b64\u503c\u7ee7\u7eed\u589e\u5927\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u5185\u5b58\u6cc4\u6f0f\u3002<\/p>\n<p>Dalvik \u65e5\u5fd7\u6d88\u606f\u4e2d\u5305\u542b\u4ee5\u4e0b\u5b57\u8bcd\uff1a<\/p>\n<p>GC \u539f\u56e0<\/p>\n<p>\u4ec0\u4e48\u89e6\u53d1\u4e86 GC \u4ee5\u53ca\u662f\u54ea\u79cd\u56de\u6536\u3002\u53ef\u80fd\u7684\u539f\u56e0\u5305\u62ec\uff1a<\/p>\n<p>GC_CONCURRENT<\/p>\n<p>\u5728\u60a8\u7684\u5806\u5f00\u59cb\u5360\u7528\u5185\u5b58\u65f6\u91ca\u653e\u5185\u5b58\u7684\u5e76\u53d1 GC\u3002<\/p>\n<p>GC_FOR_MALLOC<\/p>\n<p>\u60a8\u7684\u5806\u5df2\u6ee1\u800c\u7cfb\u7edf\u4e0d\u5f97\u4e0d\u505c\u6b62\u60a8\u7684\u5e94\u7528\u5e76\u56de\u6536\u5185\u5b58\u65f6\uff0c\u60a8\u7684\u5e94\u7528\u5c1d\u8bd5\u5206\u914d\u5185\u5b58\u800c\u5f15\u8d77\u7684 GC\u3002<\/p>\n<p>GC_HPROF_DUMP_HEAP<\/p>\n<p>\u5f53\u60a8\u8bf7\u6c42\u521b\u5efa HPROF \u6587\u4ef6\u6765\u5206\u6790\u5806\u65f6\u53d1\u751f\u7684 GC\u3002<\/p>\n<p>GC_EXPLICIT<\/p>\n<p>\u663e\u5f0f GC\uff0c\u4f8b\u5982\u5f53\u60a8\u8c03\u7528  \u65f6\u3002\u4e0d\u8fc7\uff0c\u8bf7\u907f\u514d\u8c03\u7528\u6b64\u65b9\u6cd5\uff0c\u800c\u5e94\u4fe1\u4efb GC \u4f1a\u6839\u636e\u9700\u8981\u8fd0\u884c\u3002<\/p>\n<p>GC_EXTERNAL_ALLOC<\/p>\n<p>\u5916\u90e8\u5206\u914d\u5185\u5b58\u7684 GC\uff0c\u4f8b\u5982\u5b58\u50a8\u5728\u539f\u751f\u5185\u5b58\u6216 NIO \u5b57\u8282\u7f13\u51b2\u533a\u4e2d\u7684\u50cf\u7d20\u6570\u636e\u3002\u8fd9\u4ec5\u9002\u7528\u4e8e API \u7ea7\u522b 10 \u53ca\u66f4\u4f4e\u7ea7\u522b\u3002\u66f4\u65b0\u7684\u7248\u672c\u4f1a\u5728 Dalvik \u5806\u4e2d\u5206\u914d\u4efb\u4f55\u5185\u5b58\u3002<\/p>\n<p>\u91ca\u653e\u91cf<\/p>\n<p>\u4ece\u6b64\u6b21 GC \u4e2d\u56de\u6536\u7684\u5185\u5b58\u91cf\u3002<\/p>\n<p>\u5806\u7edf\u8ba1\u6570\u636e<\/p>\n<p>\u5806\u7684\u53ef\u7528\u7a7a\u95f4\u767e\u5206\u6bd4\u4e0e\uff08\u6d3b\u52a8\u5bf9\u8c61\u6570\u91cf\uff09\/\uff08\u5806\u603b\u5927\u5c0f\uff09\u3002<\/p>\n<p>\u5916\u90e8\u5185\u5b58\u7edf\u8ba1\u6570\u636e<\/p>\n<p>API \u7ea7\u522b 10 \u53ca\u66f4\u4f4e\u7ea7\u522b\u7684\u5916\u90e8\u5206\u914d\u5185\u5b58\uff08\u5df2\u5206\u914d\u5185\u5b58\u91cf\uff09\/\uff08\u53d1\u751f\u56de\u6536\u7684\u9650\u503c\uff09\u3002<\/p>\n<p>\u6682\u505c\u65f6\u95f4<\/p>\n<p>\u5806\u8d8a\u5927\uff0c\u6682\u505c\u65f6\u95f4\u8d8a\u957f\u3002\u5e76\u53d1\u6682\u505c\u65f6\u95f4\u663e\u793a\u4e24\u4e2a\u6682\u505c\uff1a\u4e00\u4e2a\u51fa\u73b0\u5728\u56de\u6536\u5f00\u59cb\u65f6\uff0c\u53e6\u4e00\u4e2a\u51fa\u73b0\u5728\u56de\u6536\u5feb\u8981\u5b8c\u6210\u65f6\u3002<\/p>\n<p>ART \u65e5\u5fd7\u6d88\u606f<\/p>\n<p>\u4e0e Dalvik \u4e0d\u540c\uff0cART \u4e0d\u4f1a\u4e3a\u672a\u660e\u786e\u8bf7\u6c42\u7684 GC \u8bb0\u5f55\u6d88\u606f\u3002\u4ec5\u5728 GC \u4e3a\u663e\u5f0f\u6216 GC \u6682\u505c\u65f6\u95f4\u8d85\u8fc7 5 \u6beb\u79d2\u6216 GC \u6301\u7eed\u65f6\u95f4\u8d85\u8fc7 100 \u6beb\u79d2\u65f6\uff0c\u7cfb\u7edf\u624d\u4f1a\u8f93\u51fa GC \u6d88\u606f\u3002\u5982\u679c\u5e94\u7528\u672a\u5904\u4e8e\u53ef\u5bdf\u89c9\u5230\u6682\u505c\u7684\u72b6\u6001\uff08\u4f8b\u5982\u5e94\u7528\u5728\u540e\u53f0\u8fd0\u884c\u65f6\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u7528\u6237\u65e0\u6cd5\u5bdf\u89c9 GC \u6682\u505c\uff09\uff0c\u5219\u9664\u4e86\u663e\u793a GC \u5916\u7684\u4efb\u4f55 GC \u4fe1\u606f\u90fd\u4e0d\u4f1a\u88ab\u8f93\u51fa\u3002<\/p>\n<p>ART \u4f1a\u5728\u5176\u5783\u573e\u56de\u6536\u65e5\u5fd7\u6d88\u606f\u4e2d\u5305\u542b\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/p>\n<p><pre class=\"none\" dir=\"ltr\">\nI\/art: <var>GC_Reason<\/var> <var>GC_Name<\/var> <var>Objects_freed<\/var>(<var>Size_freed<\/var>) AllocSpace Objects,\n    <var>Large_objects_freed<\/var>(<var>Large_object_size_freed<\/var>) <var>Heap_stats<\/var> LOS objects, <var>Pause_time(s)<\/var>\n<\/pre>\n<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<p><pre class=\"none\" dir=\"ltr\">\nI\/art : Explicit concurrent mark sweep GC freed 104710(7MB) AllocSpace objects,\n    21(416KB) LOS objects, 33% free, 25MB\/38MB, paused 1.230ms total 67.216ms\n<\/pre>\n<\/p>\n<p>ART \u65e5\u5fd7\u6d88\u606f\u4e2d\u5305\u542b\u4ee5\u4e0b\u5b57\u8bcd\uff1a<\/p>\n<p>GC \u539f\u56e0<\/p>\n<p>\u4ec0\u4e48\u89e6\u53d1\u4e86 GC \u4ee5\u53ca\u662f\u54ea\u79cd\u56de\u6536\u3002\u53ef\u80fd\u7684\u539f\u56e0\u5305\u62ec\uff1a<\/p>\n<p>Concurrent<\/p>\n<p>\u4e0d\u4f1a\u6302\u8d77\u5e94\u7528\u7ebf\u7a0b\u7684\u5e76\u53d1 GC\u3002\u6b64 GC \u5728\u540e\u53f0\u7ebf\u7a0b\u4e2d\u8fd0\u884c\uff0c\u800c\u4e14\u4e0d\u4f1a\u963b\u6b62\u5206\u914d\u3002<\/p>\n<p>Alloc<\/p>\n<p>\u7531\u4e8e\u5e94\u7528\u5728\u5806\u5df2\u6ee1\u65f6\u5c1d\u8bd5\u5206\u914d\u5185\u5b58\u800c\u5f15\u53d1\u7684 GC\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5783\u573e\u56de\u6536\u5728\u5206\u914d\u7ebf\u7a0b\u4e2d\u53d1\u751f\u3002<\/p>\n<p>Explicit<\/p>\n<p>\u7531\u5e94\u7528\u660e\u786e\u8bf7\u6c42\u7684\u5783\u573e\u56de\u6536\uff0c\u4f8b\u5982\uff0c\u901a\u8fc7\u8c03\u7528  \u6216 \u3002\u4e0d\u8fc7\uff0c\u4e0e Dalvik \u4e00\u6837\uff0c\u5728 ART \u4e2d\uff0c\u6700\u4f73\u5b9e\u8df5\u662f\u60a8\u4fe1\u4efb GC \u5e76\u907f\u514d\u8bf7\u6c42\u663e\u5f0f GC\uff08\u5982\u679c\u53ef\u80fd\uff09\u3002\u4e0d\u5efa\u8bae\u8bf7\u6c42\u663e\u5f0f GC\uff0c\u56e0\u4e3a\u5b83\u4eec\u4f1a\u963b\u6b62\u5206\u914d\u7ebf\u7a0b\u5e76\u4e0d\u5fc5\u8981\u5730\u6d6a\u8d39 CPU \u5468\u671f\u3002\u6b64\u5916\uff0c\u5982\u679c\u663e\u5f0f GC \u5bfc\u81f4\u5176\u4ed6\u7ebf\u7a0b\u88ab\u62a2\u5360\uff0c\u5219\u4e5f\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5361\u987f\uff08\u5e94\u7528\u51fa\u73b0\u5361\u987f\u3001\u6296\u52a8\u6216\u6682\u505c\uff09\u3002<\/p>\n<p>NativeAlloc<\/p>\n<p>\u539f\u751f\u5206\u914d\uff08\u4f8b\u5982\u4f4d\u56fe\u6216 RenderScript \u5206\u914d\u5bf9\u8c61\uff09\u5bfc\u81f4\u51fa\u73b0\u539f\u751f\u5185\u5b58\u538b\u529b\uff0c\u8fdb\u800c\u5f15\u8d77\u7684 GC\u3002<\/p>\n<p>CollectorTransition<\/p>\n<p>\u7531\u5806\u8f6c\u6362\u5f15\u8d77\u7684 GC\u3002\u8fd9\u7531\u5728\u8fd0\u884c\u65f6\u53d8\u66f4 GC \u7b56\u7565\u5f15\u8d77\uff0c\u4f8b\u5982\u5e94\u7528\u5728\u53ef\u5bdf\u89c9\u5230\u6682\u505c\u7684\u72b6\u6001\u4e4b\u95f4\u5207\u6362\u65f6\u3002\u56de\u6536\u5668\u8f6c\u6362\u5305\u62ec\u5c06\u6240\u6709\u5bf9\u8c61\u4ece\u7a7a\u95f2\u5217\u8868\u7a7a\u95f4\u590d\u5236\u5230\u78b0\u649e\u6307\u9488\u7a7a\u95f4\uff08\u53cd\u4e4b\u4ea6\u7136\uff09\u3002<\/p>\n<p>\u56de\u6536\u5668\u8f6c\u6362\u4ec5\u5728\u4ee5\u4e0b\u60c5\u51b5\u4e0b\u51fa\u73b0\uff1a\u5728\u642d\u8f7d\u4f4e\u4e8e Android 8.0 \u7248\u672c\u7684\u4f4e RAM \u8bbe\u5907\u4e0a\uff0c\u5e94\u7528\u5c06\u8fdb\u7a0b\u72b6\u6001\u4ece\u53ef\u5bdf\u89c9\u5230\u6682\u505c\u7684\u72b6\u6001\uff08\u4f8b\u5982\u5e94\u7528\u5728\u524d\u53f0\u8fd0\u884c\u65f6\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u7528\u6237\u53ef\u4ee5\u5bdf\u89c9 GC \u6682\u505c\uff09\u66f4\u6539\u4e3a\u5bdf\u89c9\u4e0d\u5230\u6682\u505c\u7684\u72b6\u6001\uff08\u53cd\u4e4b\u4ea6\u7136\uff09\u3002<\/p>\n<p>HomogeneousSpaceCompact<\/p>\n<p>\u540c\u6784\u7a7a\u95f4\u538b\u7f29\u662f\u7a7a\u95f2\u5217\u8868\u7a7a\u95f4\u5230\u7a7a\u95f2\u5217\u8868\u7a7a\u95f4\u538b\u7f29\uff0c\u901a\u5e38\u5728\u5e94\u7528\u8fdb\u5165\u5230\u5bdf\u89c9\u4e0d\u5230\u6682\u505c\u7684\u8fdb\u7a0b\u72b6\u6001\u65f6\u53d1\u751f\u3002\u8fd9\u6837\u505a\u7684\u4e3b\u8981\u539f\u56e0\u662f\u51cf\u5c11\u5185\u5b58\u4f7f\u7528\u91cf\u5e76\u5bf9\u5806\u8fdb\u884c\u788e\u7247\u6574\u7406\u3002<\/p>\n<p>DisableMovingGc<\/p>\n<p>\u8fd9\u4e0d\u662f GC \u539f\u56e0\uff0c\u4f46\u8bf7\u6ce8\u610f\uff0c\u7531\u4e8e\u5728\u53d1\u751f\u5e76\u53d1\u5806\u538b\u7f29\u65f6\u4f7f\u7528\u4e86 GetPrimitiveArrayCritical\uff0c\u56e0\u6b64\u56de\u6536\u906d\u5230\u963b\u6b62\u3002\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u5f3a\u70c8\u5efa\u8bae\u4e0d\u8981\u4f7f\u7528 GetPrimitiveArrayCritical\uff0c\u56e0\u4e3a\u5b83\u5728\u79fb\u52a8\u56de\u6536\u5668\u65b9\u9762\u5b58\u5728\u9650\u5236\u3002<\/p>\n<p>HeapTrim<\/p>\n<p>\u8fd9\u4e0d\u662f GC \u539f\u56e0\uff0c\u4f46\u8bf7\u6ce8\u610f\uff0c\u5728\u5806\u4fee\u526a\u5b8c\u6210\u4e4b\u524d\uff0c\u56de\u6536\u4f1a\u4e00\u76f4\u53d7\u5230\u963b\u6b62\u3002<\/p>\n<p>GC \u540d\u79f0<\/p>\n<p>ART \u5177\u6709\u53ef\u4ee5\u8fd0\u884c\u7684\u591a\u79cd\u4e0d\u540c\u7684 GC\uff1a<\/p>\n<p>Concurrent mark sweep (CMS)<\/p>\n<p>\u6574\u4e2a\u5806\u56de\u6536\u5668\uff0c\u4f1a\u56de\u6536\u9664\u6620\u50cf\u7a7a\u95f4\u4ee5\u5916\u7684\u6240\u6709\u5176\u4ed6\u7a7a\u95f4\u3002<\/p>\n<p>Concurrent partial mark sweep<\/p>\n<p>\u51e0\u4e4e\u6574\u4e2a\u5806\u56de\u6536\u5668\uff0c\u4f1a\u56de\u6536\u9664\u6620\u50cf\u7a7a\u95f4\u548c Zygote \u7a7a\u95f4\u4ee5\u5916\u7684\u6240\u6709\u5176\u4ed6\u7a7a\u95f4\u3002<\/p>\n<p>Concurrent sticky mark sweep<\/p>\n<p>\u5206\u4ee3\u56de\u6536\u5668\uff0c\u53ea\u80fd\u91ca\u653e\u81ea\u4e0a\u6b21 GC \u540e\u5206\u914d\u7684\u5bf9\u8c61\u3002\u6b64\u5783\u573e\u56de\u6536\u6bd4\u5b8c\u6574\u6216\u90e8\u5206\u6807\u8bb0\u6e05\u9664\u8fd0\u884c\u5f97\u66f4\u9891\u7e41\uff0c\u56e0\u4e3a\u5b83\u66f4\u5feb\u901f\u4e14\u6682\u505c\u65f6\u95f4\u66f4\u77ed\u3002<\/p>\n<p>Marksweep + semispace<\/p>\n<p>\u975e\u5e76\u53d1\u3001\u590d\u5236 GC\uff0c\u7528\u4e8e\u5806\u8f6c\u6362\u4ee5\u53ca\u540c\u6784\u7a7a\u95f4\u538b\u7f29\uff08\u5bf9\u5806\u8fdb\u884c\u788e\u7247\u6574\u7406\uff09\u3002<\/p>\n<p>\u91ca\u653e\u7684\u5bf9\u8c61<\/p>\n<p>\u6b64 GC \u4ece\u975e\u5927\u578b\u5bf9\u8c61\u7a7a\u95f4\u56de\u6536\u7684\u5bf9\u8c61\u6570\u91cf\u3002<\/p>\n<p>\u91ca\u653e\u7684\u5927\u5c0f<\/p>\n<p>\u6b64 GC \u4ece\u975e\u5927\u578b\u5bf9\u8c61\u7a7a\u95f4\u56de\u6536\u7684\u5b57\u8282\u6570\u91cf\u3002<\/p>\n<p>\u91ca\u653e\u7684\u5927\u578b\u5bf9\u8c61<\/p>\n<p>\u6b64\u5783\u573e\u56de\u6536\u4ece\u5927\u578b\u5bf9\u8c61\u7a7a\u95f4\u56de\u6536\u7684\u5bf9\u8c61\u6570\u91cf\u3002<\/p>\n<p>\u91ca\u653e\u7684\u5927\u578b\u5bf9\u8c61\u5927\u5c0f<\/p>\n<p>\u6b64\u5783\u573e\u56de\u6536\u4ece\u5927\u578b\u5bf9\u8c61\u7a7a\u95f4\u56de\u6536\u7684\u5b57\u8282\u6570\u91cf\u3002<\/p>\n<p>\u5806\u7edf\u8ba1\u6570\u636e<\/p>\n<p>\u53ef\u7528\u7a7a\u95f4\u767e\u5206\u6bd4\u4e0e\uff08\u6d3b\u52a8\u5bf9\u8c61\u6570\u91cf\uff09\/\uff08\u5806\u603b\u5927\u5c0f\uff09\u3002<\/p>\n<p>\u6682\u505c\u65f6\u95f4<\/p>\n<p>\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u6682\u505c\u65f6\u95f4\u4e0e GC \u8fd0\u884c\u65f6\u4fee\u6539\u7684\u5bf9\u8c61\u5f15\u7528\u6570\u91cf\u6210\u6b63\u6bd4\u3002\u5f53\u524d\uff0cART CMS GC \u4ec5\u5728 GC \u5373\u5c06\u5b8c\u6210\u65f6\u6682\u505c\u4e00\u6b21\u3002\u79fb\u52a8 GC \u7684\u6682\u505c\u65f6\u95f4\u8f83\u957f\uff0c\u4f1a\u5728 GC \u7684\u5927\u90e8\u5206\u65f6\u95f4\u6301\u7eed\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5728 Logcat \u4e2d\u770b\u5230\u5927\u91cf GC \u6d88\u606f\uff0c\u8bf7\u6ce8\u610f\u5806\u7edf\u8ba1\u6570\u636e\u7684\u589e\u5927\u60c5\u51b5\u3002\u5982\u679c\u6b64\u503c\u7ee7\u7eed\u589e\u5927\uff0c\u4e14\u59cb\u7ec8\u6ca1\u6709\u53d8\u5c0f\u7684\u8d8b\u52bf\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u5185\u5b58\u6cc4\u6f0f\u3002<\/p>\n<p>\u6216\u8005\uff0c\u5982\u679c\u60a8\u770b\u5230\u539f\u56e0\u4e3a\u201cAlloc\u201d\u7684 GC\uff0c\u5219\u60a8\u5df2\u5feb\u8981\u8fbe\u5230\u5806\u5bb9\u91cf\u4e0a\u9650\uff0c\u5e76\u4e14\u5f88\u5feb\u4f1a\u51fa\u73b0\u5185\u5b58\u4e0d\u8db3\u5f02\u5e38\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3\u5982\u4f55\u4f7f\u7528 Android Studio \u4e2d\u7684 Logcat \u7a97\u53e3\u663e\u793a\u7cfb\u7edf\u6d88\u606f\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[777,703],"_links":{"self":[{"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=\/wp\/v2\/posts\/393"}],"collection":[{"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=393"}],"version-history":[{"count":0,"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=\/wp\/v2\/posts\/393\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=393"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}