Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[完成作业] #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jjzhoujun
Copy link

极客时间账号: 18689538156
感悟:对于此次作业,断断续续拖了一个多月才完成,原因是做的时候发现没头绪,然后工作又忙了一下,不忙的时候试了一下发现还是搞不定,看着群也没怎么讨论,提交的PR也没几个,又没动力去弄作业。后面听着大家们聊天啥的,遇到困难,走出舒适区才能有所成长,不然一直都是一年的经验被几年重复用。 于是乎花一大块两个晚上时间,看PR和参考Haha和Pref库,在各位PR的帮助下,完成了此次作业。
实现方法:1.App下用代码加载几张重复的image图片,并dump出hprof文件;
2.引入Haha库加载hprof文件(注意如果文件过大,一些低配手机或者模拟器会OOM,这里我没花时间找怎么裁剪hprof文件,采用的是加载重复的小图片,这样生成的hprof文件也小);
3.HahaHelper的方法,得引入 Leakcanary库才有,并且遇到调用 fieldValue 方法是 protected 方法,所以参考其他PR,把对应的源码Copy出来,然后来操作;
4.解析对比“app”和“default” 里面有没有重复的hashcode的图片,打印出引用链。

最后感谢之前同学的PR参考以及自己的不放弃,坚持走出舒适区才能有所成长!@@

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant