Questions tagged [android-memory]

android-memory is generally Runtime Memory of Android device. This is the memory which is required run time for the execution of application or process or service. Typically RAM plays this role.

Run time memory requirement solely depends on application use case that is required to execute on android OS. A lot of memory in android is actually shared across multiple processes, so how much memory a process uses is really not clear.

  • For each java application & service, the instance of DVM (Dalvik Virtual Machine) will be loaded into the memory.

  • Runtime Service & Native Service will communicate using IPC binder (Android Implementation). Therefore binder library will be loaded into the memory.

  • Runtime Service & Native Daemon will communicate using sockets (Kernel Implementation).

  • In brief android run time environment mainly categorize into

    1. Libraries : Shared Objects
    2. Applications : .apk
    3. Frameworks : Core libraries & Services
    4. Services : Run time android services
    5. Daemon : Run time Linux Daemons
    6. Utilities : Android Shell, /system/bin, /system/xbin

To learn more about memory management in Android you can look at this great video: Google I/O 2011: Memory management for Android Apps

360 questions
167
votes
6 answers

What are advantages of setting largeHeap to true?

I have an application with large number of classes & also many libraries are included, I am setting android:largeHeap="true" as i am getting memory issue, My Manifest file code is attached.
Intsab Haider
  • 3,491
  • 3
  • 23
  • 32
165
votes
5 answers

What is the maximum amount of RAM an app can use?

I am quite curious about this question concerning the memory management of the Android operating system so I hope for a quite detailed answer on that topic. What I would like to know: What is the maximum amount of memory (in megabytes /…
Philipp Jahoda
  • 50,880
  • 24
  • 180
  • 187
25
votes
4 answers

android.view.InflateException: Binary XML file line #2: Error inflating class

I am developing a simple android apllication and just completed the home screen. Now if the orientation of the screen changes more than two times, it is throwing the error and application is getting crashed abrubptly. Here is my Java Class: public…
Ravindra
  • 289
  • 1
  • 4
  • 10
22
votes
7 answers

Release Memory of Particular Activity when it is Destroyed

I have a launcher Activity that load and resize big bitmap as it's background when it opens. Whenever hit the back button, the Activity is destroyed. But I think the memory is not released yet. When I open back the app, hit the back button and open…
JayVDiyk
  • 4,277
  • 22
  • 70
  • 135
15
votes
6 answers

How to get the minimum Hardware requirements for an android application

I and some team members developed an android application which collects data on field with mobile. Now this application is going to production. So general people will use this application. We also need to write a Documentation which will explain all…
Vinit ...
  • 1,409
  • 10
  • 37
  • 66
13
votes
2 answers

Memory not freeing after fragment is removed

I have a Fragment which has a RecyclerView. In this RecyclerView, I may occasionally download and display images (loaded with Glide into ImageView. So when I open the Fragment, used memory may sometimes jump from around 30MB to around 100MB or even…
Guy
  • 6,414
  • 19
  • 66
  • 136
13
votes
2 answers

Android Studio 2.1.2 'Dump Java Heap' Not working (Mac OS El Capitan)

I am trying to get an .hprof file using the 'dump java heap' button in Android Studio memory monitor, but for some reason no .hprof file is generated. Does anybody know why? Allocation Tracking works okay.
codename_47
  • 449
  • 2
  • 17
13
votes
2 answers

Android app crashes without any exception, when trying to sign in with Google plus

I'm developing an app, which has a LoginActivity with a Google plus sign-in button. I've already Enabled the Google+ API in Google's api console and made an Oauth account. Here is the relevant part of my code: activity class declaration: public…
13
votes
5 answers

Saving to SD card as text file

stopWriting = (Button) findViewById(R.id.save); stopWriting.setOnClickListener(new OnClickListener() { @SuppressLint("SdCardPath") public void onClick(View v) { // stop recording the sensor data try { …
user2967906
  • 131
  • 1
  • 1
  • 3
11
votes
1 answer

adb shell dumpsys meminfo - What is the meaning of each cell of its output?

I was looking at the output given below for the command adb shell dumpsys meminfo com.imangi.templerun However, I am not able to understand this properly. Can anybody help me understand this?
Mayank
  • 1,099
  • 4
  • 17
  • 44
11
votes
1 answer

parse memory snapshot hprof index files programmatically

I am trying to programmatically analyze an hprof file. Using the hprof-conv tool in the android-sdk I generated a bunch of com.your.package.index files. How do I programmatically parse these .index files? I want run some custom analysis on the…
Abhishek
  • 1,749
  • 9
  • 27
  • 39
10
votes
1 answer

Android memory leak on textview - LeakCanary (Leak can be ignored)

I keep having the following memory leak as displayed by LeakCanary, when I go from my splash screen to the mainactivity. I understand that this is an expected leak due to fault in the Android OS itself, but is there a way I can avoid this (by…
dowjones123
  • 3,695
  • 5
  • 40
  • 83
10
votes
5 answers

Bitmap recycle with largeHeap enabled

Before enabling largeHeap option, I was handling large bitmaps and it's consume almost the entire memory available for the application, and recycling it over navigation and loading new ones works round on almost the full heap available. However when…
Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167
9
votes
5 answers

BitmapFactory.decodeResource and inexplicable Out of Memory

I get a strange Out of Memory error decoding a drawable image resource 960x926px jpg, allocating 3555856 byte. The image is placed only in drawable-xxhdpi (3x) and I am using a hdpi (1.5x) device. Two question: why I get the error though having…
GPack
  • 2,494
  • 4
  • 19
  • 50
9
votes
3 answers

SharedElement and custom EnterTransition causes memory leak

Having a shared element animation and also a custom enter animation causes the activity to leak. Any idea what might be the cause? 09-21 16:19:31.007 28269-31066/com.sample.android D/LeakCanary﹕ * com.feeln.android.activity.MovieDetailActivity…
Olsi Saqe
  • 383
  • 5
  • 12
1
2 3
23 24