简体   繁体   English

Android活动每次增加2mb

[英]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.

相关问题 Android Volley无法处理2mb json文件 - Android volley can't handle a 2mb json file 在应用程序启动时在Android中加载(反序列化)_quickly_ 2MB数据 - loading (deserializing) _quickly_ 2MB of Data in Android on Application Startup 输入大小〜2Mb较慢的Hadoop mapreduce - Hadoop mapreduce with input size ~ 2Mb slow 位图无法加载2MB的图像 - Bitmap can't load a 2MB image Java堆分配是2MB的倍数 - Java Heap Allocation is in multiples of 2MB 每次在android oreo上解锁设备时都会启动活动 - launch an activity every time the device is unlocked on android oreo 每次我开始上一个活动时Android应用程序崩溃 - Android app crashes every time i start the previous activity 每次启动或恢复时,Android应用程序/活动是否完全启动? - Android App/Activity To Start Fresh Completely every time it starts or resumes? Android-每次启动活动时,SwitchCompat OnCheckedChangeListener操作都会运行 - Android - SwitchCompat OnCheckedChangeListener action is running every time the activity is started 从 Android 手机上传 mp4 到 Spring 服务器导致文件丢失几百字节如果大于 2MB - Uploading mp4 from Android phone to Spring server results in file missing a few hundred bytes if bigger than 2MB
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM