#0202 · 方法
内存泄漏拍三张快照
帮我查内存泄漏,按这个办法:
1. 启动后拍第一张堆快照;
2. 重复 [可疑操作] 100 次,拍第二张;
3. 再重复 100 次,拍第三张;
4. 找出数量一直在涨的对象类型;
5. 顺着引用链找到是谁一直握着它们不放。
每一步告诉我具体用什么工具和命令。
Help me find a memory leak this way:
1. Take a heap snapshot after startup.
2. Repeat [suspect action] 100 times, take a second one.
3. Repeat another 100 times, take a third.
4. Find the object types whose count keeps rising.
5. Follow the retainer chain to whoever keeps holding them.
Tell me the exact tool and commands for each step.
小杜
已贴 1,040 张上墙共收到 0 个章