Memory metrics in android apps
I wrote Android application and it have some strange problems with Out Of Memory exception, which appears randomly. Yes, I know that problems with OOM exception usually because of images, and I used all what I can to avoid this problem. The only way I could think to find the place where spend the memory is putting the logs with information about memory everywhere. But I really confused about which values do I need.
I used next values:
And before OOM exception I have next values:
In this question Android Bitmap Limit - Preventing java.lang.OutOfMemory I see that used compeering ((reqsize + Debug.getNativeHeapAllocatedSize() + heapPad) >= Runtime.getRuntime().maxMemory()) ant in this blog some strange information:
Debug.getNativeHeapFreeSize(); The free size is the amount of memory from the heap that is not being used, because of fragmentation or provision.
Also I can not understand haw can be OOM exception if (totalMemory: 22407K) much less than (maxMemory: 57344K).
Please help me understand how use this values.
链接地址: http://www.djcxy.com/p/93060.html下一篇: 内存指标在android应用程序