当我的应用程序在连接的设备上运行时,我刚刚在终端中运行了以下命令。adb shell dumpsys meminfo com.mine.application 获得表格后,我还会获得一个“资产分配”列表,如下所示:
Asset Allocations
zip:/data/app/com.mine.application-1.apk:/resources.arsc: 115K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaBold.otf: 374K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaOblique.otf: 3
85K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaBold.otf: 374K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaOblique.otf: 3
85K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaBold.otf: 374K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaOblique.otf: 3
85K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaBold.otf: 374K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaOblique.otf: 3
85K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaBold.otf: 374K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaOblique.otf: 3
85K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaBold.otf: 374K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaOblique.otf: 3
85K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaBold.otf: 374K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaOblique.otf: 3
85K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaBold.otf: 374K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaOblique.otf: 3
85K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaBold.otf: 374K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaOblique.otf: 3
85K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaBold.otf: 374K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaOblique.otf: 3
85K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaBold.otf: 374K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaOblique.otf: 3
85K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaBold.otf: 374K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaOblique.otf: 3
85K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaBold.otf: 374K
zip:/data/app/com.mine.application-1.apk:/assets/HelveticaOblique.otf: 3
85K
这发生在我多次运行我的应用程序的某些部分之后。我是否认为这意味着 Helvetica 字体被分配了很多次?并用完所有加在一起的内存?此外,由于一旦我退出该特定活动,这些分配就不会被删除,我认为这是内存泄漏是否正确?
如果这是真的,我是否会确保在 onPause 时取消对字体的任何引用以解决此问题?谢谢。