largeHeap =真正的清单标记不工作? [英] largeHeap=true manifest tag not working?
问题描述
I'm开发一个非常占用内存的应用程序,并希望使用largeHeap标签,这应该给应用程序多一点的内存。无论我在AndroidManifest.xml中设置此标记,它没有区别的实际内存从来就被赋予。 I'm读出我的最大内存是这样的:
I´m developing a very memory-consuming app and want to use the largeHeap-Tag, which should give the application a bit more memory. Whatever I set this tag in AndroidManifest.xml to, it makes no difference to the actual memory I´ve been given. I´m reading out my max memory like this:
Log.v("Utils","Max Mem in MB:"+(Runtime.getRuntime().maxMemory()/1024/1024));
我的表现看起来很是这样的:
My manifest looks quite like this:
<application android:label="@string/app_name" android:hardwareAccelerated="true" android:largeHeap="true" android:debuggable="true">
<activity android:name=".EntryActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
I'm运行在仿真器3.1,我记录的输出上面永远是48MB。有人可以帮忙吗?
I´m running 3.1 in the emulator, output of my logging above is always 48MB. Can somebody help?
推荐答案
使用<一个href="http://developer.android.com/reference/android/app/ActivityManager.html#getMemoryClass%28%29">ActivityManager.getMemoryClass()和<一href="http://developer.android.com/reference/android/app/ActivityManager.html#getLargeMemoryClass%28%29">ActivityManager.getLargeMemoryClass()验证分配给您的应用程序的近似值。
Use ActivityManager.getMemoryClass() and ActivityManager.getLargeMemoryClass() to verify the approximated values assigned to your app.
这篇关于largeHeap =真正的清单标记不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!