Bitmap Allocations Different per phone

by MikeL » Sat, 12 Mar 2011 04:21:52 GMT

Sponsored Links
 I have an application that I am running on an HTC EVO and an HTC
Incredible.  At one point it loads in 10+ new bitmaps.  The Evo runs
fine, the Incredible runs out of memory.  I have been using 'dumpsys
meminfo' to debug the problem.  I noticed something odd right away.
These are numbers on initial boot..

** MEMINFO in pid 2677 [] **
                         native   dalvik    other    total    limit
bitmap nativeBmp
              size:    19348     5767      N/A    25115    24576
N/A      N/A
       allocated:    17110     4794      N/A    21904      N/A
8445        0

** MEMINFO in pid 3474 [] **
                         native   dalvik    other    total    limit
bitmap nativeBmp
              size:    19356     5447      N/A    24803    24576
N/A      N/A
       allocated:    16589     4018      N/A    20607      N/A
11323        0

The Bitmap field is much higher on the Incredible than on the EVO.  As
I load more bitmaps this differences grows and grow until I run out of
memory with...

E/dalvikvm-heap( 3474): 515520-byte external allocation too large for
this process.
E/dalvikvm( 3474): Out of memory: Heap Size=5767KB, Allocated=3154KB,
Bitmap Size=18681KB
E/        ( 3474): VM won't let us allocate 515520 bytes

Why is it that the bitmap sizes are larger on the Incredible?  Is
there something in the OS I can look at this will explain this?


Other Threads

1. Age of GPS data (continued)

Hi all

Just updating this thread, which seems to be too old for me to post a

2. PendingIntent / addProximityAlert problem

i have some questions about the addProximityAlert function.
My task is to develop an android navigation application. The app reads
some gps point out of a gpx-file.
Thats not really a problem. If the handy is near the point, the app
shall notify me this. So i used the addProximityAlert function:

setProximityAlert () {
double lati = lat[arrayindex]; //the saved gps data
double lng = lon[arrayindex];
Intent intent = new Intent(TREASURE_PROXIMITY_ALERT);
proximityIntent = PendingIntent.getBroadcast(getApplicationContext(),
0, intent, 0);
lm.addProximityAlert(lati, lng, radius, expiration, proximityIntent);
IntentFilter filter = new IntentFilter(TREASURE_PROXIMITY_ALERT);
registerReceiver(new ProximityIntentReceiver(), filter);

public class ProximityIntentReceiver extends BroadcastReceiver
          public void onReceive (Context context, Intent intent) {
            String key = LocationManager.KEY_PROXIMITY_ENTERING;
            entering = intent.getBooleanExtra(key, false);
            if (entering)

The setProximityAlert () function is called if the position has

I develop the app with the emulator and Android SDK 1.5. I use the
console with geo fix commands to simulate gps data.

If you can see in this lines of code, I use an arrayIndex. I've save
all gps data of the gpx file in an array. If the handy is near the
first point, the ProximityAlert notify, that the handy enters this
My problem is, that sometimes the ProximityAlert fires only one time,
sometimes 3 times or more.
I think the problem is the expiration time? But if I took a value like
2000 (2sec), the proximityAlert only works for 2 seconds?!

A solution can be, that I use multiple proximityIntents variables, so
that I save all proximityAlerts with addProximityAlert function only
once. But if I than enters the position of the third gps point before
the second or first point, the ProximityAlert will fire, but it
shouldn't before them!
What can I do? Must I implement a subactivity, which starts when I
entered the first position, than raise a counter and go back into the
main activity? I think the problem will be the same?


PS: I'm german, so apologize some mistakes. And this project is my
first in the Android world. So i'm not an expert..


3. PendingIntent ProximityAlert problem

4. Add space between elements in a TableRow.

5. Some G1 phones getting "device not found" with adb...

6. Date.getTime() and Daylight Saving Time?

7. Bitmap in GLSurfaceView