The memory does not release after removing the fragment

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 m

The Android app does not close properly by clicking

Post has been edited I've programmed an android app as a practice project for learning purposes. I face an issue where when I press on the back button on the main activity after visiting the settings activity and making a change in there (checkbox op

Android Games: Strategies to defeat memory editors to deceive

I have simple game with 2 variables to store the score and best score: int HightScore, CurrentScore; I save the socre by SharedPreferences static SharedPreferences app_preferences; //Save hight score example SharedPreferences.Editor hightScore = app_

OnPictureTaken () camera sometimes not called

I have an app published to Google Play, which at some point takes a picture using the front facing camera from a background service. Now, I've gotten complaints from users that this specific part of the app is not very consistent, that I know is true

Bitmap OutOfMemoryError even using recycle ()

I have an app that shows a lot of activities, each one showing a bitmap that fits the 100% of the width of the screen and normally more than the 100% of the height. When you touch the screen, a new activity is created, and in the previous activity is

Installing the Android app in internal or external memory

My app is bit heavier in size. Currently I am installing it in internal memory. I can also use android:installLocation="preferExternal" to install it in external memory. However,I want to modify that ,I want my app to initially use internal memo

How Heap Memory Allocation Works

I'm working on an app and I have memory issues. I started to study this thing and I have met Eclipse's debugging system. I use DDMS's Heap tester to see how much memory my app allocated. I saw it's about 90%. Now I made a simple new project, a blank

Clear Android application data programmatically

Manually I can do Settings -> Applications -> Manage applications -> (choose my app) -> Clear data How do I do this programmatically? I need to delete all data, including those in shared preferences (, and variables).Everything in your applica

Internal memory and integer output?

I would like to know the Total Internal Memory and write it in a Preference so I wrote this code: File path = Environment.getDataDirectory(); StatFs stat = new StatFs(path.getPath()); long blockSize = stat.getBlockSize(); long totalBlocks = stat.getB

Saving to an SD card as a text file

stopWriting = (Button) findViewById(; stopWriting.setOnClickListener(new OnClickListener() { @SuppressLint("SdCardPath") public void onClick(View v) { // stop recording the sensor data try { myFile = new File("/sdcard/SensorData/&

Weak reference Android background

In some of my apps I use a few singleton objects as "managers." I instantiate them in Application.onCreate and I pass them the ApplicationContext, which I store in a WeakReference. Some of the "manager's" methods start a background tas

Best way to animate frame by frame images in Android

I have 3 sets of 50 images and I have to create the animations for each set of images in Android application. I am able to create a simple application which animate first set of 50 images using the below method, Added Animation-list xml in drawable f

What is the maximum amount of RAM that an application 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 / as percentage

The native heap continues to increase

First I'm using API 10. I have activity A and activity B. I launch activity B from A. Then I call finish() in the oncreate() of B. I then launch activity B from A again and so on. When i do this my native heap keeps increasing by about .5 MB every ti

"Insufficient Memory" Error Using ViewPager Image

I'm new to Android and I am trying to implement a ViewPager for image browsing. I am using a library called UrlImageViewHelper to load in the images from URL strings. I am having trouble with a memory leak after scrolling through the first 4-5 images

Insufficient memory problem when loading bitmaps in Android

I am using Fedor's code( for loading bitmaps. I have modified a few lines of code, according to my requirement. I am getting out of memory error when ever the heap memory crosses the threshold. There are various que

Manipulating objects in Android

I want to keep some objects in memory for operations in all the activities of my app and I also want to store those objects when the app closes. Which is the most efficient way of doing this ? Some possibilities that I can think of are: 1) Keeping lo

The activity has a memory leak on ()

There is back button on my layout and the Dialog is being called on every click on it. On a click I am first checking whether the progress dialog is visible i.e whether the Asynch Task is running, if yes than on Yes button click of a dialog I am call

Overflow of android memory

UPDATE : 10/12/2012 After making with images: WeakHashMap<Bitmap, WeakReference<Bitmap>> objReferenciaDebilBitmaps; Bitmap imagen = datossss.getImagen(); objreCReferencias.RegristrarReferenciaDebilBitmap(imagen, objReferenciaDebilBitmaps); my