Oops, the largeHeap attribute should go inside the application tag -- this
works now.
On Wednesday, 30 May 2012 12:04:40 UTC-4, Ab wrote:
>
> I added the android:largeHeap="true" attribute to my android manifest,
> but it doesn't seem to make a difference in my application's allowed
> memory. When I run the below activity on my Acer A100 (running
> android 3.2.1), I get the following results:
>
> largeAmount = 256
> normalamount = 48
> allowedMax = 48
> outofmemoryexception allocating the 60mb byte array.
>
>
> public class TempActivity extends Activity {
> @Override
> public void onCreate(Bundle savedInstanceState)
> {
> super.onCreate(savedInstanceState);
>
> ActivityManager manager = (ActivityManager)
> getSystemService(ACTIVITY_SERVICE);
> int largeAmount = manager.getLargeMemoryClass();
> int normalAmount = manager.getMemoryClass();
>
> long allowedMax =
> Runtime.getRuntime().maxMemory()/1024/1024;
>
> byte[] bigarray = new byte[62914560];
> }
> }
>
> <manifest xmlns:android="http://schemas.android.com/apk/res/
> android"
> package="com.temp"
> android:largeHeap="true"
> android:versionCode="1"
> android:versionName="1.0" >
> <uses-sdk android:minSdkVersion="11"
> android:targetSdkVersion="11"/>
> <application
> android:icon="@drawable/ic_launcher"
> android:label="@string/app_name" >
> <activity
> android:name=".TempActivity"
> 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>
> </manifest>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en