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..

EVO
** MEMINFO in pid 2677 [my.app.here] **
                         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

Incredible
** MEMINFO in pid 3474 [my.app.here] **
                         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. LVL security, are you sure that is secure, I'm a doubt in...?





Actually it doesn't matter whether they have a rooted phone.  This is one of
the big reasons for moving to this over forward locking -- forward locking
requires trusting the device and its operating system to protect the app.
 With the new licensing model, the app does not need to have any trust in
the device it is running on or the market client app.  This gets rid of all
of the issues that forward locking has with apps not showing up on devices
that were not whitelisted/trusted.

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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.

-- 

2. Inner ListView not respecting layout gravity or width

I have a ListView that contains several elements, one of which is
another ListView.
All elements of the outer ListView except for the inner ListView
respect their layout params.

The inner ListView respects margin left/right, but toally ignores
layout_gravity and layout_width.
Ie consumes the entire row sans the margins and is left justified.

I'd really like to have the inner ListView of the right hand side of
th screen.
I suspect its something obvious I am doing, but after several hours I
can't see it.
Any one got any ideas?

Here is the lauout for the inner ListView

    <ListView android:id="@+id/rawContactsList"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginLeft="5px"
              android:layout_marginRight="3px"
              android:layout_gravity="right"
    />

Here is the config for the
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
        android:id="@+id/test_raw_contact_entry"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right"
        >

    <TextView android:id="@+id/contactId"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            />

    <TextView android:id="@+id/rawContactId"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

</LinearLayout>

-- 

3. how to self-close an Activity

4. Contract Opportunity::::: iPhone Quality Assurance Tester | Kirkland, WA

5. Urgent Position For ::: Blackberry Mobile Developer | Kirkland, WA

6. Text blinking effect TextView

7. Placing a MapView inside a LinearLayout