request max heapsize?

by Tomasz » Sun, 15 May 2011 00:31:20 GMT

Sponsored Links
 Hi guys,

Is there a way for an application to request a larger than normal
maximum heap size? I have an application which needs around 100mb RAM
(and this is with lots of tricks to decrease memory usage).

Newer phones with 500mb+ should have no problem coping with this. Any
advice is very much appreciated.



Re: request max heapsize?

by Tomasz » Sun, 15 May 2011 00:59:58 GMT

 I have found some references to a manifest file attribute,
However if I try and use this I get the following error on
error: No resource identifier found for attribute 'largeheap' in
package 'android'


Sponsored Links

Re: Re: request max heapsize?

by Harri Smæ°“tt » Sun, 15 May 2011 01:51:29 GMT


android:largeHeap="true" is mentioned here; #getLargeMemoryClass%28%29

It's API level 11 method, could it be so that this attribute is too?



Re: Re: request max heapsize?

by Dianne Hackborn » Sun, 15 May 2011 02:27:03 GMT

 Yes this was introduced in 3.0.

2011/5/14 Harri Smtt <>

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


Other Threads

1. Would you at least give us names

I know you have plans, but at least share with us who won in round 1.
Some of us have plans and need to know if they lost so they can start
selling their app or otherwise wait and keep their app free.
Instead of keeping thousands of users in the dark, announce the 200
and let others start planning.

This is really annoying, it's been almost three weeks and you won't
give information, you're delaying the release of the thousands of
application because of this! most developers will be annoyed when they
find out they lost and that they were waiting in vain.


2. OnLocationChanged never called

Hello there! I'm trying to create a simple app to test GPS
integration. Using the emulator and geo fix commands from telnet I'm
able to get it working as expected. But installing it on a device,
when I click on the first button to start listening for updates I can
see the the GPS is active (by the small radar icon) but, moving
around, It never updates the textfields it were suppose to update.

Any ideas?


import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.sax.TextElementListener;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends Activity {
    /** Called when the activity is first created. */

      private boolean amIListening = false;

    public void onCreate(Bundle savedInstanceState) {
        Button btn = (Button)this.findViewById(;
        Button btn2 = (Button)this.findViewById(;

        final LocationManager lm = (LocationManager)getSystemService
        final LocationListener gpsListener = new MyGPSListener(this);

        btn.setOnClickListener(new OnClickListener() {

                        public void onClick(View v) {
                                        lm.requestLocationUpdates("gps", 5000, 
0, gpsListener);
                                        amIListening = true;

        btn2.setOnClickListener(new OnClickListener() {

                        public void onClick(View v) {
                                        amIListening = false;


    private class MyGPSListener implements LocationListener{

        private Activity activity;

        public MyGPSListener(Activity parent){
                this.activity = parent;

                public void onLocationChanged(Location location) {
                        Double lat = location.getLatitude();
                        Double lon = location.getLongitude();
                        Double alt = location.getAltitude();
("Latitude: " + lat);
("Longitude: " + lon);
("Altitude: " + alt);

                public void onProviderDisabled(String provider) {
                        // TODO Auto-generated method stub


                public void onProviderEnabled(String provider) {
                        // TODO Auto-generated method stub


                public void onStatusChanged(String provider, int status, Bundle
extras) {
                        // TODO Auto-generated method stub



3. Modular packaging - Queries

4. ContentResolver in a Service

5. Will Android apps every make proper money ...

6. make seekbar (un)clickable depending on RadioButton

7. ListViews in tabs