OutOfMemory problem

by Kofa » Sun, 18 Apr 2010 17:50:22 GMT

Sponsored Links
 I really don't know why it's giving me this error...
I load an ImageView with an image of 692kb .jpg, using scroll options,
so you can scroll it around... the strange it's that when the mobile
it's connected to the VM it's less possible to happen.
So...how can I prevent this? is there anyway that I can free memory
when starting the app? can I tell the system to free memory before
loading the image? please show me the path =P....thx a lot!


OutOfMemory problem

by Streets Of Boston » Sun, 18 Apr 2010 23:59:28 GMT

 How big, in pixels, is the image?


Sponsored Links

OutOfMemory problem

by patbenatar » Mon, 19 Apr 2010 17:36:16 GMT

 You say your error doesn't happen as often if you are plugged into
your computer? Is that what you mean by VM? If so, that's likely
because you're developing your code at the time and every time you run
it on the device it kills and restarts your process.. leaving little
time for memory leaks to lead to OutOfMemory errors. Just FYI.

As for your OutOfMemory errors, this can be a really tough one to
debug.. Your app is leaking memory somewhere, but its hard to say
where. The image is not necessarily the problem, it could simply be
the tipping point that finally forces your app to crash. I would
recommend reading over all the articles tagged "Optimization" over at


> >

OutOfMemory problem

by Kofa » Thu, 22 Apr 2010 02:56:07 GMT

 I'm looking at this blog about Optimization, thanks patbenatar.
The image it's 1920x1440 pixels, hope it helps.


OutOfMemory problem

by Kofa » Thu, 22 Apr 2010 02:57:22 GMT

 the image it's 1920x1440 pixels

> >

OutOfMemory problem

by Streets Of Boston » Thu, 22 Apr 2010 03:41:21 GMT

 1920p * 1440p * 2Bytes/p = 2764800*2 = 5529600 Bytes per image.

That's a big chunk and only a one time leak could cause your memory
Track your code and see where you possibly cache the reference to this
large Bitmap.
Note that memory used by Bitmaps (the internal array of bytes) is not
part of the DalvikVM and won't show up when you do java memory
profiling. However, this memory is part of the overall memory used by
the app's process.

> > >

Other Threads

1. Android for Affective Computing


I'm currently exploring on how android-powered phones can be used to develop
applications (affective computing) that can recognize emotions from its user
particularly in detecting laughter though audio and video.

Are you developing a similar or somehow related applications in android?

What other ways can an android-powered phone receive additional affective
inputs (besides voice and video)?

Can it be attached with other sensors to add affective features (i.e,  heart
rate, skin sensors, etc).

Thank you and I hope you can help me.



2. Searchable Dictionary Example - Update Search Bar

Hi for those who are familiar with the search bar this would be a
quick answer (hopefully). If you look @ the searchable dictionary
example (http://developer.android.com/guide/samples/
SearchableDictionary/index.html) it uses a content provider to
populate suggestions. That works great however when I use the
navigation keys to focus on certain suggestions this does not update
my current search string. And also how is it possible that instead of
launching the search straight away, when a person clicks on a
suggestion it only replaces the current search query. An example may
help better understand the question.

Press Search
Use keyboard to enter the letter 'a' in the search box
The suggestions "apple" "altogether" "apricot" are shown

I use the down navigation key to get to" apricot", however the text in
the search box is still just "a", I want it to become "apricot"

And also when I press apricot on the suggestion I dont want it to
launch the intent but rather just replace the text in search box to
the text selected, and only actually launch the intent when the user
clicks the search button/enter key.

I'm sure its just a value I need to set somewhere but I cant seem to
find it in the documentation.


3. Require J2ME (Android) developers with hands on experience in Blackberry & Android for Catalytic Software Limited (CMML5)

4. Can the packages which begin with "com.google" be used for free?

5. DHCP request failed wifi with WEP2 enterprise

6. Accessibilityservice

7. Playing Audio file to the caller