1

My android app's service uses 2.9 MB and nearly 5 MB when there is a notification?

Whether it's good or I should cut down on memory usage?

Can someone tell me the ways to cut down on memory usage?

Shan
  • 2,822
  • 9
  • 40
  • 61
  • I am just trying out on what are the ways to reduce memory usage whether there are any standard ways to reduce memory usage..? – Shan Jul 02 '11 at 09:17

2 Answers2

1

Its always advisable that your code use optimal memory.

Though this might give you idea about memory state in an app. http://developer.android.com/reference/android/app/ActivityManager.html#getMemoryClass

To go on statistic, in general its 24M.

Whether it's good or I should cut down on memory usage?

Of course why not if its possible.

Can someone tell me the ways to cut down on memory usage?

This is discussed here What are some Java memory management best practices?

Community
  • 1
  • 1
Rajnikant
  • 1,097
  • 1
  • 7
  • 22
0

Memory is a very precious resource in Android, proper management of Heap Space is very important as the heap size for an Android app can be as low as 16MB (HTC G1).

  • Use logcat effectively to monitor if there are any memory leaks.
  • Use WeakReference/SoftReference to allow GC to collect more objects (more efficiently).
  • Use tools like MAT (for eclipse) to pin point leaks.

Read more about these here.

Codevalley
  • 4,593
  • 7
  • 42
  • 56