{"id":1361,"date":"2016-03-03T11:56:53","date_gmt":"2016-03-03T03:56:53","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=1361"},"modified":"2026-08-18T12:58:49","modified_gmt":"2026-08-18T04:58:49","slug":"android%e5%86%85%e5%ad%98%e6%b3%84%e6%bc%8f%e6%9f%a5%e6%89%be%e5%8f%8a%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=1361","title":{"rendered":"\u5185\u5b58\u6cc4\u6f0f\u63a2\u8ba8\u4e0b(\u89e3\u51b3\u65b9\u6cd5)"},"content":{"rendered":"<section id=\"wenyan\" style=\"font-family: system-ui, 'Apple Color Emoji', 'Segoe UI', 'Segoe UI Symbol', 'Noto Sans', Roboto, sans-serif; line-height: 1.75; font-size: 16px; color: #000000; caret-color: #000000;\" data-provider=\"WenYan\">\n<blockquote style=\"margin: 20px 0px; display: block; font-size: 0.9em; overflow: auto; border-left: 3px solid #ef7060; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"margin: 1em 0px;\">\u53d1\u751f\u5185\u5b58\u6cc4\u6f0f\uff0c\u5148\u67e5\u518d\u89e3\u3002\u68c0\u67e5\u7528 DDMS \u91cc\u7684 <strong>Heap<\/strong>\uff0c\u5206\u6790\u7528 <strong>MAT<\/strong>\uff1b\u65e5\u5e38\u5f00\u53d1\u8fd8\u53ef\u4ee5\u63a5 <strong>LeakCanary<\/strong>\uff0c\u5728 debug \u5305\u91cc\u628a dump \u548c\u8def\u5f84\u7b97\u597d\u3002<\/p>\n<\/blockquote>\n<p><!--more--><\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e00\u3001\u5185\u5b58\u6cc4\u6f0f\u7684\u68c0\u67e5\u5de5\u5177 Heap<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u5de5\u6b32\u5584\u5176\u4e8b\u5fc5\u5148\u5229\u5176\u5668\u3002Heap \u7528\u6765\u5927\u81f4\u5224\u65ad\u6709\u6ca1\u6709\u6cc4\u6f0f\uff0cMAT \u7528\u6765\u5206\u6790\u6cc4\u6f0f\u53d1\u751f\u5728\u54ea\u91cc\u3002\u5f00\u53d1\u73af\u5883 DDMS \u80fd\u627e\u5230\u8fd9\u4e24\u4e2a\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923191.jpg\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923191.jpg\" alt=\"201601120923191\" width=\"1366\" height=\"728\" class=\"alignnone size-full wp-image-1423\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u5177\u4f53\u64cd\u4f5c\uff1a<\/p>\n<ol style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: decimal;\">\n<li>\n<section>\u5728 Devices \u8bbe\u5907\u5217\u8868\u91cc\u627e\u5230\u8bbe\u5907\uff0c\u70b9\u8981\u76d1\u63a7\u7684\u8fdb\u7a0b\u3002<\/section>\n<\/li>\n<li>\n<section>\u70b9 \u201cUpdate Heap\u201d \u66f4\u65b0\u5806\u5185\u5b58\u3002<\/section>\n<\/li>\n<li>\n<section>\u70b9 \u201cHeap\u201d \u89c6\u56fe\u770b\u5185\u5b58\u3002<\/section>\n<\/li>\n<li>\n<section>\u6bcf\u6b21 Activity \u9000\u51fa\u548c\u8fdb\u5165\u65f6\u70b9 \u201cCause GC\u201d\uff0c\u624b\u52a8\u8c03\u7528 GC\u3002<\/section>\n<\/li>\n<li>\n<section>\u89c2\u5bdf data object \u90a3\u4e00\u884c\u3002\u6bcf\u6b21\u70b9 Cause GC \u770b Total Size\uff0c\u5982\u679c\u4e0d\u65ad\u589e\u5927\uff0c\u8bf4\u660e\u5b58\u5728\u6cc4\u6f0f\u3002<\/section>\n<\/li>\n<\/ol>\n<p style=\"margin: 1em 0px;\">\u5148\u6a21\u62df\u6cc4\u6f0f\uff0c\u518d\u7528 Heap \u5224\u65ad\u3002\u6cc4\u6f0f\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">public class LeakAty extends Activity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.aty_leak);\n        testLeak();\n    }\n\n    \/**\n     * \u6d4b\u8bd5\u5185\u5b58\u6cc4\u6f0f\u7684\u4ee3\u7801\n     *\/\n    private void testLeak() {\n        new Thread(new Runnable() {\n            @Override\n            public void run() {\n                while (true) {\n                    try {\n                        Thread.sleep(1000);\n                    } catch (InterruptedException e) {\n                        e.printStackTrace();\n                    }\n                }\n            }\n        }).start();\n    }\n}<\/code><\/pre>\n<p style=\"margin: 1em 0px;\"><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">new Runnable(){}<\/code> \u662f\u975e\u9759\u6001\u533f\u540d\u5185\u90e8\u7c7b\uff0c\u4f1a\u5f3a\u5f15\u7528\u5916\u56f4\u5bf9\u8c61 LeakAty\u3002\u6253\u5f00\u65b9\u5411\u65cb\u8f6c\uff0c\u4e0d\u65ad\u8f6c\u5c4f\u8ba9 LeakAty \u53cd\u590d\u521b\u5efa\u3002\u6ca1\u6709\u8fd9\u6bb5\u4ee3\u7801\u65f6\uff0c\u65e7 Activity \u4f1a\u5728 onDestroy \u4e4b\u540e\u88ab\u56de\u6536\uff1b\u6709\u4e86\u5b83\uff0cRunnable \u4e00\u76f4\u8dd1\u3001\u4e0d\u4f1a\u88ab\u56de\u6536\uff0c\u5b83\u5f3a\u5f15\u7528\u7684 LeakAty \u4e5f\u4e0d\u4f1a\u88ab\u56de\u6536\u3002\u8f6c n \u6b21\uff0c\u5185\u5b58\u91cc\u5c31\u6709 n+1 \u4e2a LeakAty\u3002<\/p>\n<p style=\"margin: 1em 0px;\">Heap \u7b2c\u4e00\u6b21\u6309 Cause GC\uff1a<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923202.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923202.png\" alt=\"201601120923202\" width=\"1366\" height=\"728\" class=\"alignnone size-full wp-image-1424\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u4e0a\u56fe data object \u7684 Total Size \u4e3a 1.031M\u3002\u591a\u6b21\u65cb\u8f6c\u540e\u518d\u770b\uff1a<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923203.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923203.png\" alt=\"201601120923203\" width=\"1366\" height=\"728\" class=\"alignnone size-full wp-image-1426\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">Total Size \u53d8\u6210 2.059M\u3002\u6bcf\u6b21 GC \u540e data object \u603b\u5927\u5c0f\u6ca1\u6709\u56de\u843d\uff0c\u53ef\u4ee5\u8bc1\u5b9e\u5b58\u5728\u6cc4\u6f0f\u3002\u6cc4\u6f0f\u53d1\u751f\u5728\u54ea\uff0c\u4ea4\u7ed9 MAT\u3002<\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e8c\u3001\u5185\u5b58\u6cc4\u6f0f\u7684\u5206\u6790\u5de5\u5177 MAT<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">MAT \u9700\u8981 .hprof\u3002\u901a\u8fc7 \u201cDump HPROF file\u201d \u8f6c\u5b58\u5f53\u524d\u5806\uff0c\u4fdd\u5b58\u4e3a 1.hprof\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923204.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923204.png\" alt=\"201601120923204\" width=\"1366\" height=\"728\" class=\"alignnone size-full wp-image-1427\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u5bfc\u51fa\u7684 1.hprof \u8981\u7528 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">..\\sdk\\tools\\<\/code> \u4e0b\u7684 hprof-conv.exe \u8f6c\u6362\uff0c\u624d\u80fd\u88ab MAT \u5bfc\u5165\uff0c\u8f6c\u6210 out1.hprof\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923205.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923205.png\" alt=\"201601120923205\" width=\"659\" height=\"434\" class=\"alignnone size-full wp-image-1428\" srcset=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923205.png 659w, https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923205-90x60.png 90w\" sizes=\"(max-width: 659px) 100vw, 659px\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">File \u2192 Open Heap Dump\u2026 \u5bfc\u5165 out1.hprof\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923206.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923206.png\" alt=\"201601120923206\" width=\"1366\" height=\"728\" class=\"alignnone size-full wp-image-1429\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u70b9\u5de6\u8fb9 Overview\uff0cActions \u2192 Histogram\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923207.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923207.png\" alt=\"201601120923207\" width=\"1366\" height=\"728\" class=\"alignnone size-full wp-image-1430\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u60f3\u77e5\u9053 Activity \u6709\u6ca1\u6709\u6cc4\u6f0f\uff0c\u8f93\u5165\u5173\u952e\u8bcd Activity\uff0c\u56de\u8f66\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923208.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923208.png\" alt=\"201601120923208\" width=\"1366\" height=\"728\" class=\"alignnone size-full wp-image-1431\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u4e0b\u56fe\u641c\u7d22\u7ed3\u679c\u91cc Activity \u5b9e\u4f8b\u6709 7 \u4e2a\u3002\u70b9\u9009\u4e2d\u7ea2\u8272\u6846\uff0c\u53f3\u952e \u2192 Merge Shortest Paths to GC Roots \u2192 exclude all phantom\/weak\/soft etc. references\u3002\u6392\u9664\u865a\u5f15\u7528\u3001\u5f31\u5f15\u7528\u3001\u8f6f\u5f15\u7528\uff0c\u5269\u4e0b\u90fd\u662f\u5f3a\u5f15\u7528\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923209.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/201601120923209.png\" alt=\"201601120923209\" width=\"1366\" height=\"728\" class=\"alignnone size-full wp-image-1432\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u8fc7\u6ee4\u51fa\u6765\u7684\u5f3a\u5f15\u7528\u5217\u8868\u91cc\uff0c\u8fd9\u4e03\u4e2a\u5b9e\u4f8b\u90fd\u88ab Thread \u5f15\u7528\uff0c\u8bc1\u5b9e\u4e0a\u9762\u7684\u4ee3\u7801\u786e\u5b9e\u6cc4\u6f0f\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/2016011209232010.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2016\/03\/2016011209232010.png\" alt=\"2016011209232010\" width=\"1366\" height=\"728\" class=\"alignnone size-full wp-image-1433\" \/><\/a><\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e09\u3001\u4f7f\u7528 LeakCanary \u68c0\u6d4b Android \u7684\u5185\u5b58\u6cc4\u6f0f<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u4ec0\u4e48\u662f <a data-spm-anchor-id=\"5176.blog3009.yqblogcon1.23\">LeakCanary<\/a>\uff1f\u4e3a\u4ec0\u4e48\u9009\u5b83\uff1f<\/p>\n<p style=\"margin: 1em 0px;\">LeakCanary \u662f Pierre-Yves Ricau \u5f00\u53d1\u7684\u5f00\u6e90\u5e93\uff0c\u7528\u6765\u68c0\u6d4b\u5185\u5b58\u6cc4\u9732\u3002\u5bf9\u6218\u6cc4\u6f0f\u901a\u5e38\u8981\u7ecf\u8fc7\uff1a<\/p>\n<ol style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: decimal;\">\n<li>\n<section>\u4e86\u89e3 OutOfMemoryError \u60c5\u51b5\u3002<\/section>\n<\/li>\n<li>\n<section>\u91cd\u73b0\u95ee\u9898\u3002<\/section>\n<\/li>\n<li>\n<section>\u53d1\u751f\u6cc4\u9732\u65f6\u628a\u5185\u5b58 Dump \u51fa\u6765\u3002<\/section>\n<\/li>\n<li>\n<section>\u5206\u6790 dump\uff0c\u5b9a\u4f4d\u53ef\u7591\u5bf9\u8c61\u3002<\/section>\n<\/li>\n<li>\n<section>\u8ba1\u7b97\u8fd9\u4e2a\u5bf9\u8c61\u5230 GC roots \u7684\u6700\u77ed\u5f3a\u5f15\u7528\u8def\u5f84\u3002<\/section>\n<\/li>\n<li>\n<section>\u786e\u5b9a\u8def\u5f84\u91cc\u54ea\u4e2a\u5f15\u7528\u4e0d\u8be5\u6709\uff0c\u7136\u540e\u4fee\u590d\u3002<\/section>\n<\/li>\n<\/ol>\n<p style=\"margin: 1em 0px;\">\u5f88\u590d\u6742\u3002\u5982\u679c\u6709\u4e00\u4e2a\u5e93\u80fd\u5728 OOM \u4e4b\u524d\u628a\u8fd9\u4e9b\u4e8b\u60c5\u505a\u5b8c\uff0c\u4f60\u53ea\u8981\u4fee\u95ee\u9898\u5c31\u597d\u2014\u2014LeakCanary \u505a\u7684\u5c31\u662f\u8fd9\u4ef6\u4e8b\u3002\u53ef\u4ee5\u5728 debug \u5305\u91cc\u8f7b\u677e\u68c0\u6d4b\u5185\u5b58\u6cc4\u9732\u3002<\/p>\n<table style=\"border-collapse: collapse; margin: 1.4em auto; max-width: 100%; table-layout: fixed; text-align: left; overflow: auto; display: table; overflow-wrap: break-word; word-break: break-all;\" width=\"817\">\n<thead>\n<tr>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u5de5\u5177<\/th>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u5e72\u4ec0\u4e48<\/th>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u5173\u952e\u52a8\u4f5c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Heap<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u5224\u65ad\u6709\u6ca1\u6709\u6cc4\u6f0f<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Cause GC \u540e\u770b data object Total Size \u662f\u5426\u53ea\u589e\u4e0d\u51cf<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">hprof-conv + MAT<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u5b9a\u4f4d\u8c01\u63e1\u7740\u5bf9\u8c61<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Histogram \u2192 Merge Shortest Paths to GC Roots\uff08\u6392\u9664\u5f31\/\u8f6f\/\u865a\u5f15\u7528\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">LeakCanary<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">debug \u5305\u81ea\u52a8\u8d70\u5b8c\u4e0a\u8ff0\u6b65\u9aa4<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u4f60\u8d1f\u8d23\u4fee\u90a3\u6761\u4e0d\u8be5\u5b58\u5728\u7684\u5f3a\u5f15\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote style=\"margin: 20px 0px; display: block; font-size: 0.9em; overflow: auto; border-left: 3px solid #ef7060; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"margin: 1em 0px;\"><strong>\u4e00\u53e5\u8bdd\u603b\u7ed3\uff1aHeap \u770b Total Size \u53ea\u589e\u4e0d\u51cf\uff0cMAT \u6cbf\u5f3a\u5f15\u7528\u627e\u5230 GC Root\uff0cLeakCanary \u5219\u628a dump \u548c\u8def\u5f84\u8ba1\u7b97\u63d0\u524d\u505a\u5b8c\uff0c\u4f60\u53ea\u8d1f\u8d23\u526a\u65ad\u90a3\u6761\u4e0d\u8be5\u6709\u7684\u8fb9\u3002<\/strong><\/p>\n<\/blockquote>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u53d1\u751f\u5185\u5b58\u6cc4\u6f0f\uff0c\u5148\u67e5\u518d\u89e3\u3002\u68c0\u67e5\u7528 DDMS \u91cc\u7684 Heap\uff0c\u5206\u6790\u7528 MAT\uff1b\u65e5\u5e38\u5f00\u53d1\u8fd8\u53ef\u4ee5\u63a5 LeakCanar [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[45],"tags":[77],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1361"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1361"}],"version-history":[{"count":3,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1361\/revisions"}],"predecessor-version":[{"id":1434,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1361\/revisions\/1434"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}