内存问题,我的Android应用 [英] Memory issue with my Android app
问题描述
大家好,我的Android应用程序正在我联想A319设备上的精细,在这个设备,它消耗同时对银河S5设备40 MB的RAM,它消耗300 MB为同一版本(APK)。而我得到很多的误区,如银河S5设备上存储的问题。
Hi my Android application is working fine on my Lenovo a319 device , in this device it consuming 40 MB of RAM meanwhile on the Galaxy s5 Device , it consuming 300 Mb for the same build(apk). And I am getting lot of errors such as memory issue on Galaxy s5 device.
有关实例
内存不足。
例外,
android.view.InflateException:二进制XML文件中的行
android.view.InflateException: Binary XML file line
错误。我发现这个<一个href=\"http://stackoverflow.com/questions/4512981/android-view-inflateexception-binary-xml-file-line-12-error-inflating-class\">Question 在那里回答说,高像素的分辨率会导致内存异常,我无法摆脱,在这个问题提供的答案,请提供相同的支持任何线索?
errors. I have found this Question where it is answered that high pixel resolution will cause memory exception , I am not able to get any clue from that answers provided in that Question , kindly provide the support on the same?
编辑:
感谢您的答案,但他们inacurate我再利用回收的位图和我让他们空,甚至调用System.gc();而我的记忆中是恒定的,我只是不明白,为何需要300 MB RAM在sumasung galxy S5和40只在我的联想。我的联想是华电国际S5 IS xxhdpi如果我敢肯定。
Thanks for the answers but they are inacurate i reuse recycle bitmaps and i make them null, even call system.gc(); and my memory is constant, i just do not understand that why it takes 300 MB of ram at sumasung galxy s5 and just 40 on my lenovo. My lenovo is hdpi s5 is xxhdpi if i am sure.
推荐答案
这件事可能是这个一个简单的办法
This thing can be an easy fix for this
刚加入这一行你的应用程序标记清单文件
just add this line in your application tag in manifest file
的android:largeHeap =真正的
像这样
&lt;应用
机器人:largeHeap =真
机器人:allowBackup =真
......
如果你想更优化code,那么使用存储分析仪在eclipse
and if you want to more optimize your code then use Memory Analyser in eclipse
这篇关于内存问题,我的Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!