[英]Android activity adds 2mb every time
everytime I quit my Android app and restart, it consumes 2 Mb extra, for example if I restart my app 3 times, it consumes 6 Mb more. 每次我退出Android应用程序并重新启动时,它都会多消耗2 Mb,例如,如果我重新启动应用程序3次,它会多消耗6 Mb。 I use the back button to quit and I clean all references in OnDestroy().
我使用后退按钮退出,并清理OnDestroy()中的所有引用。
I went through all the posts in stack overflow pertaining to memory management and memory leak in Android, I also did a MAT but there is no way my activities are leaking memory(holding reference), 我遍历了堆栈溢出中与Android中的内存管理和内存泄漏有关的所有帖子,我也做了MAT,但是我的活动无法泄漏内存(持有参考),
I also tried the same thing with other applications but they maintain a constant memory usage of +/- 0.75 Mb. 我也尝试过与其他应用程序进行相同的操作,但是它们保持+/- 0.75 Mb的恒定内存使用率。
I am confused about Android memory management. 我对Android内存管理感到困惑。
I got this Fixed! 我得到这个固定的! The problem was, in my Grid View Adapter I was setting the typeface for the grid icon texts everytime, I should have set the typeface in the On Create generically.
问题是,在我的Grid View Adapter中,每次都要为网格图标文本设置字体,我应该在“创建时”中设置字体。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.