Bastaix
Bastaix

Reputation: 845

Android app RAM usage

I have just made an app for Android phones. It is a rather simple app, yet it uses up to 25 MB RAM.

Not to get any answer to this specific app but in general what is using a lot of RAM in android? (I know this is a rather broad question, but I was just wondering)

EDIT What i mean is if one should use arrays rather than ArrayList, use private Class when possible and so on.

Update I have now made the RAM usage a little smaller (half). I have made String final when possible and created a public class instead of a inner private class. (don't know if this it what caused it).

Update

I now found the BIG RAM eater. I had some ImageViews, which were referenced a picture in the picture gallery via an URI path.

So my question have change: new Question is here:)

Upvotes: 2

Views: 3766

Answers (2)

CommonsWare
CommonsWare

Reputation: 1007624

but in general what is using a lot of RAM in android?

Bitmaps. It is difficult to run out of RAM unless you are using lots of bitmap images or doing something that should be blindingly obvious as a potential RAM issue (e.g., loading 10,000 records out of a database).

You can dump the heap using DDMS and inspect it using the Eclipse MAT plug-in, if you want to learn more about what is going on inside your app's RAM.

Upvotes: 5

madman1969
madman1969

Reputation: 166

I would review your application against the guidelines listed in the Android Developers Dev Guide.

Not being aware of certain recommended practices could result in heavy memory usage by your app.

Upvotes: 1

Related Questions