3

I'm sorry for asking this duplicate question. But as you can see in that link the topic is saying one thing but the content is about something else.

I'm not asking how to manage or how to monitor the memory, just want to know how much memory usage you call a memory friendly app. And from what range you consider as using too much memory.

Thank you

Mehran
  • 481
  • 1
  • 9
  • 26
  • 1
    as a coder, you should really take memory seriously, and you should use as little as possible. Garbage collector will help you to recycle the allocated memory, but you should think about the lifespan of any instance of objects you create, and also about their design so to minimize the structures. Last but not least, Studio allows you to profile the memory allocation of your app, so use it – Alessio Aug 24 '18 at 06:27

1 Answers1

0

Short Answer: As low as possible.

Long Answer: To allow multiple running processes, Android sets a hard limit on the heap size alloted for each app. The exact heap size limit varies between devices based on how much RAM the device has available overall. If your app has reached the heap capacity and tries to allocate more memory, the system throws an OutOfMemoryError, and to avoid running out of memory, you can to query the system to determine how much heap space you have available on the current device.

You can query the system for this figure by calling getMemoryInfo(), which provides information about the device's current memory status, including available memory, total memory, and the memory threshold—the memory level at which the system begins to kill processes.

For more details, see this https://developer.android.com/topic/performance/memory

Qasim
  • 5,181
  • 4
  • 30
  • 51