Android :: Application - Activity's Memory Management

Mar 1, 2010

I have a problem with my application, and it's about a Virtual memory error: ERROR/AndroidRuntime(19790): java.lang.OutOfMemoryError: bitmap size exceeds VM budget

The story is like this: I have an activity (let's call it A), the user click on a button from this activity, then i will make an api call somewhere in the internet, and after the result is back i start a subactivity (let's call it B).

In the activity B i have to dinamicaly load some images from the resources folder. I load the images into bitmaps -> drawables -> imageviews. After the user click's on some buttons i have to setResult(..), finish(), and get back to activity A.

The thing is that, goes from activity A to B, then B -> A, then A -> B for a few times, my app crashes with the message above: it doesn't have enough memory to load the interface.

I can not maintain the activity B on the stack because i don't want the user to go to this activity without going through activity A first.

Android :: application - activity's memory management


Android :: Memory Management Outside Heap

Jan 15, 2010

I am working on an application for android and we since we have lots of graphics, we use a lot of memory.

I monitor the memory heap size and its about 3-4 Mb , and peeks of 5Mb when I do something that requires more memory (and then goes back to 3). This is not a big deal, but some other stuff is handled outside the heap memory, like loading of drawables.

For example if I run the ddms tool outside eclipse, and go to sysinfo, I see that my app is taking 20Mb on the Droid and 12 on the G1, but heap size are the same in both, because data is the same but images are different.

So the questions are: How do I know what is taking the memory outside the heap memory? What other stuff takes memory outside the heap memory? Complex layouts (big tree) ? Animations?

View 2 Replies View Related

Android :: Insufficient Memory Error When Launching Application For Second Time After Calling Finish - In Main Activity

Apr 21, 2009

I have made a game with just one activity.. I just replace the views when I want to change screen. The game runs fine for a really long time inspite of what ever I do within the game.

But once I close the main game, by calling finish on the only activity in the application, and then when I start again, within the next 30 secs it crashes telling VM budget exceeded..

When I don't have a dispose() or a delete method in JAVA.. how the, am I supposed to remove the objects used in memory.. moreover I have android:launchMode="singleInstance" in my manifest

View 4 Replies View Related

HTC Droid Eris :: Memory Management - Task Killing?

Feb 22, 2010

Ok after seeing the somewhat heated threads on here about whether or not to use a task killer to help mange memory and improve performance on the droid Eris I decided to run my own little unscientific test.

So just a bit of background, Ive been in enterprise wide IT for 10 years now. I will say that my O/S knowledge is not exactly current but that may not be a bad thing for this. I will also state that what I report is just my own experience and I have not repeated is several times to validate anything. YMMV!

About four weeks ago my Eris was running like poo. Slow, lag city and getting almost unusable. I had been using Advanced Task killer quite liberally during this time trying to keep the device usable. Short term it seemed to help restore some of the response issues but it didnt take long before I was trying reboots to get the phone working well. Here is a list of apps I had installed at the time.

Pandora
Weather Bug
Shop Savy
Google Sky
Daily Dilbert
Bloom County
WiFi Analyzer
Silent Mode Toggle
Taskiller
SpareParts
battery Widget
Robot Guitarist
keyring reward
tv.com
NPR News
Movies
Shazam
Zedge
ip-calc
aldiko
JogTracker
UnitConverter
Backgrounds
photoshop mobile
plink art
Weather channel
Radar now
Last.fm

Plus a few others that had been removed.

That quite a few apps but not overboard in my book, and most seem to be pretty stable.

Anyway I decided to wipe the device and start over again, but with the debate raging I decided that I was not going to run any sort of task killer or other memory manager. And that I was going to run for at least four weeks and report the results. I will say I trimmed some of the redundant apps (weather bug replaced all the other weather apps nicely)

I have to say that over all I dont feel like I need a memory manager or task killer. It would be hard to say that the phone is a zippy as it was right after I wiped it, but as of now its no where near as laggy as it was before I wiped it. I feel my battery life is just fine, but I am not one who thinks that battery is an issue anyway. If there is 10% left when my head hits the pillow at night then I am a happy camper.

So this does beg the question what does using a memory manager really do for your experience on the phone? I cant for sure state that using a task killer caused my lag issues before, but it was not helping at the time either. My apps and usage have not changed very much other then not using a task killer and as of now my phone is running pretty darn well.

For me I am pretty firmly in the do-not-need-a-task-killer-camp for now. And before you flame or argue with me I challenge you to try it both ways for a while (with a clean wipe). I am sure that others have had a different experiences and maybe using one works for them.

View 3 Replies View Related

Android :: Need Application Management App

Aug 27, 2010

Looking for an app that manages applications a little better than the stock option..

More specifically.. I want to see for sure what apps are running on the phone, what apps are running on SD, etc.

Stock management shows whats on SD, but not whats on phone, unless I'm missing something.

View 1 Replies View Related

Android :: Project Management / Business - Money Management Applications?

Oct 30, 2009

I currently have a personal (HTC Touch Pro) and business phone (iPhone). With Sprint now offering unlimited any-mobile (freeing up 1300+ minutes a month on my family plan) and Google Voice allowing me to get a separate business number, I'm thinking about dropping my iPhone, and replacing the HTC with either a BlackBerry Tour or a Hero. I work in project management; I know that the BB does have applications that would be useful to me (as does the iPhone), but I can't find comparable apps for Android. As a personal phone though, I would rather have the Hero. Given that I've only been able to spend a limited amount of time browsing the Android Market in a Sprint store, I was hoping someone here might know of some good replacements for my "must have" apps.

1) PIM / Task management. I have a lot of tasks, meetings, and deadlines to manage. I need something similar to the functionality provided by Outlook. I currently use Pocket Informant on the iPhone, which allows me to view multiple calandars, see my schedule from the month-level view, and integrate my to-do lists. I can also assign calander events and to-do tasks to projects, give them priority, provide extra notes, add multiple reminders, etc.. I could probably live with the Android's calander, but I definately need a good to-do app.

2) Time tracking. I have an app on the iPhone (TimeLogger) that lets me track how much time I spend on projects for clients. The one I currently use allows me to start a timer and then come back later to stop it, which is helpful but not a must.

3) Personal finance manager. I track all of my purchases, have several accounts / cards, and need to be able to track/filter business vs personal purchases.

View 5 Replies View Related

Android :: Handles Power Management Application?

Oct 3, 2009

I am looking for an application that handles power management. I downloaded the Power Management app, but the free app has limited features. I am looking for a free app.

View 2 Replies View Related

Android :: New Application - Money Management (Incomes And Expenses)

Jul 5, 2010

A new app has been release for android - Money Manager. please have a look on the website at Money Manager - Money Management (incomes and expenses) for Android

View 1 Replies View Related

Android :: Android Activity Sequence Management Not Working

Oct 11, 2010

I have some problem with "how android manage its activity called from another activity" i m using the following code... whenever i execute the program on the device... it execute the "second "activity first before executing the "first" activity. program display the "second" activity first. after pressing back button it display the "first" activity. but i need to execute them in calling sequence as we call methods in java.

View 1 Replies View Related

Sprint HTC Hero :: Any Good Application For Podcast Management?

Nov 13, 2009

Anyone know of a good podcast management app. I was spoiled with apple's os. Right now I am just dragging them over, but when I have music everything gets mixed in with each other.

View 21 Replies View Related

Android :: How To Find Where Memory Leaks In Activity?

May 20, 2010

When start Activity A, I found the memory usage of application is about 5MB. Then start Activity B from A via startActivity. In Activity B, I created a thread, and traverse file system in this thread, after traversing completed, call finish() and to return to Activity A. At this time, I found the memory usage of application is about 8MB (GC is forced before check memory usage). How to find Where memory leaks? By the way, I checked the memory usage with DDMS.

View 5 Replies View Related

Android :: Memory Leak In Activity - Reclaiming

Sep 24, 2009

In my app activity A creates activity B, however when the back key is pressed it goes back to activity A. This is a simplified version of my application. I would expect memory to be reclaimed when going back to Activity A. Going to activity B allocates more memory. I am using dumpsys meminfo to get the allocated kbs. How can I easily tell what memory is creeping? I do not keep any references to activity B. I know about the ddms allocation tracker, but wondering if there is a more better tool to figure this out.

View 2 Replies View Related

Android :: Activity Objects In Memory After On Destroy

Aug 3, 2009

I have a activity MyActivity, which "kills" yourself using the finish () method. The problem is: after the kill operation, method onDestroy is called, but the object of type MyActivity is never garbage-collected (I forced the GC run). It is causing a memory leak, because MyActivity is launched many times, by other activities. Does anyone know when the Activity object is supposed to be garbage- collected, and what can be done to avoid the issue I mentioned?

View 2 Replies View Related

Android : Activity Lifecycle Cause Memory Leaking

Aug 7, 2009

http://developer.android.com/reference/android/app/Activity.html

The Activity Lifecycle could have implementation and or design bug: One case is to initialize a big image in onCreate(), try to reuse the image during the whole lifecycle, and then recycle the image in onDestroy(). Test showed that onCreate() is called every time one navigate away from the activity and back again, but onDestroy() is not called at all. This behavour causes memory leaking for the big image (size 960*1920). After 6+ times away and back to activity, the system runs out of memory and has to kill the process.

One workaround is to initialize the big image in onResume() and recycle in onPause(), but that's not so good reuse.

Could it be better to change the process (as shown in the diagram) a little bit such as: Call onDestroy() first when a process is killed?

View 3 Replies View Related

Android :: Free Up Memory By Finishing An Activity After Calling Another?

Feb 25, 2010

Hopefully the title wasn't to confusing but what I meant was the following:

Lets say activity A starts activity B by calling:

Intent myIntent = new Intent(Activity_A.this, Activity_B.class);
Activity_A.this.startActivity(myIntent);


Could I save/free up some memory by finishing Activity_A after Activity_B is begun (if thats even possible). Maybe through the following:

Intent myIntent = new Intent(Activity_A.this, Activity_B.class);
Activity_A.this.startActivity(myIntent);
Activity_A.finish();


Or would Acitivty_A call startActivity() and wait for Activity_B to finish before it called finish()?

The idea would then be that when the users end with Activity_B, it would just restart Acitivity_A (and finish itself in a similar fashion)? Would this create too much overhead? Thanks for any answers and I apologize if the formatting of this post isn't correct.

View 2 Replies View Related

Android :: Tell How Close Activity Is To Reaching Its Memory Limit

Oct 15, 2010

I'm writing a graphic design application for Android where the user can add several images to a document, where each image is stored as a Bitmap object. Each bitmap has roughly a dimension of 800x400 pixels and uses ARGB8888 pixel format (i.e. ~1.5Mb each).

I'm aware that most of the first generation Android devices have a 16Mb heap limit and this limit is 24Mb and larger for newer phones. I'm also aware that bitmap memory is allocated externally, but I'm confused and what the implications of this is.

My question is: How can I tell at runtime when adding a new Bitmap will get me too close to the memory limit?

Before someone suggests "don't use that much memory", I know that one option I have is to limit how many Bitmaps the user can create such that I know this limit is safe for the most basic Android phones. However, I'd like for phones with a bigger memory limit to support more bitmaps and/or bigger bitmaps.

I know to check for OutOfMemory exceptions when allocating bitmaps. However, there will be some situations where I've only got just enough memory left to allocate one more bitmap. After this point, the whole application will be unstable because even allocating small things like strings could cause an OutOfMemory exception. This is something I want to avoid.

I'm not sure how to define "too close to the memory limit", but I suspect something like "don't allocate more than half of your available memory to bitmaps" would work OK as my other data structures I store in memory are small in comparison.

View 3 Replies View Related

Android :: Low Memory Cause Activity.getIntent() To Return Null?

Sep 10, 2009

As the title says? Or what situations can cause this method to return null? I would of thought it retained this object always.

View 2 Replies View Related

Android :: Simulate Killing Activity To Conserve Memory?

Mar 1, 2010

Android doc say:"When the system, rather than the user, shuts down an activity to conserve memory, ... "
But how to simulate this situation?I want to debug the onRestoreInstanceState method,but don't know how to.

View 2 Replies View Related

Android :: Simple Frame Animation - Memory Leak Activity

Apr 14, 2010

I am using a simple frame animation and when I exit and reenter my activity the activity is still referenced in memory.

//This is a sample activity I created to simulate the problem public class MemoryLeakActivity extends Activity {
@Override public void onCreate(final Bundle savedInstanceState) super.onCreate(savedInstanceState);
} @Override public boolean onKeyDown(final int keyCode, final KeyEvent event) {
final Intent i = new Intent(MemoryLeakActivity.this, LeakyActivy.class);
startActivity(i); return super.onKeyDown(keyCode, event);
} }

View 3 Replies View Related

Android :: Force RecognizerIntent Activity To Stay Cached/in Memory

Feb 16, 2010

I was wondering if it is possible to force the RecognizerIntent Activity (or any other Activity) to stay cached so that the launch time would be faster.

View 2 Replies View Related

Android :: Way To Visualize Activity Stack (activities In Memory) On Droid?

Jun 26, 2010

I'm currently debugging my app which is quite complex and has up to 5 activity levels. In order to detect memory leaks (i.e. activities that aren't removed from memory even finish() is called, due to some references held somewhere) I want to check which activities are still alive in memory. Currently I create hprof dumps, but it's not very convenient, cause every time I need to mount the sdcard, copy the hprof dump file from the sdcard to my PC, etc. (Side note: I already tried to automate the pulling of my hprof file more easily, but I'm on an unrooted device and adb pull <hprof file> won't let me / no permission.) Therefore I am wondering, if all I want to know is IF and WHICH activities are still currently alive in my memory, is there a way through the Android API or any other way on-the-fly with which I can achieve this (list all alive activities of my app), programatically.

View 2 Replies View Related

Android :: Out Of Memory Error On Large Bitmaps And Activity Life Cycle

Jul 24, 2010

I have a scrollable map app which for now has a huge bitmap. It loads fine on startup, but when it looses foreground status and the user brings it backs again im getting an out of memory error. In onPause it trashes the bitmap using recycle, and marks it as null. The onResume checks to see if map==null and will load the bitmap back again, which is crashing the program despite me recycling the bitmap...Here are some bits of code. All of the other references to Bitmap map first check if it is null before loading/drawing..............

View 1 Replies View Related

Android :: Application Menu Rather Than Each Activity In Application?

Jul 27, 2009

Is it possible to attach Menu to an application rather than each activity in the application? I have 20-23 activities in my application and it doesn't make sense me to add same menu to all the activities.

View 5 Replies View Related

Android :: Out Of Memory Resuming Application

Feb 22, 2010

My application uses a single activity to switch between different views. I premise I'm loading a good amount of bitmaps in one of this view (say the gamescreen view) constructor but I recycle everything on the onDetachedFromWindow method.All the Bitmaps are static and most of them loaded with BitmapFactory. decodeResource method.Furthermore I'm using a gallery wich content is a simple layout with eight imagebuttons.I know all the complications using this widget and all the risks of using static bitmaps, but, I guess my problem does not entail them because my application is running well if I try to switch between these two view (and I've tried to do it about 30 times without crashes!!!) but when I pause and resume the application two times (pause->resume->pause->resume) I run out of memory, and often without the crash message (it just stays on the actual view).

View 13 Replies View Related

Android :: Allocate Memory To My Application?

Jan 25, 2010

I am getting a "bitmap size exceeds VM budget" error. I have read that there is a 16MB memory limit. In this thread Romain Guy says that "you can only allocate 16 MB of memory for your entire application".

However, my app must be running out of memory long before it reaches that limit. So my question is: how do I allocate memory to my application ... how can I get the allocation to my app increased (within the 16MB maximum)?

View 3 Replies View Related

Android :: Memory Profiling An Application

Jul 7, 2009

How do we profile an android application's memory ?

View 2 Replies View Related

Android :: How To Do Memory Profiling For An Application

Oct 4, 2010

Can you please tell me how can I do memory profile for an android application? I want to find out how are the objects created and where did those created.

View 1 Replies View Related

Android :: Why Application Has Less Heap Memory Than Others?

Nov 18, 2010

My question may look naive but I do not know how to formulate it more correctly. The problem is that I create and use large simple type arrays in my application.

And I get errors like: ERROR/dalvikvm-heap(1763): Out of memory on a 7907344-byte allocation.

Yes, it's big enough but task management tools claim that my application is using only 30MB of memory, while other at the same time use 50MB and even 110MB (have seen once) and there is still 190MB of free memory in the system (not system applications, just other ordinary applications I have installed). If all applications are provided with the same heap size at startup how can they grow so big?

View 1 Replies View Related

Android :: Application Download On Device Memory

Oct 8, 2010

I was trying to download application from OTA server on my device but fails as SDCard is not present in it.Is it possible to download application in device memory?

View 1 Replies View Related

Android :: Memory / Resource Leak With Application

Nov 24, 2009

I am experiencing a memory / resource leak on a T-Mobile G1 device with my application. I installed the "Task Manager" application from Android market and my memory usage is not monotonically increasing. It stays relatively flat over time. Furthermore, none of the other processes are chewing up tons of memory either (really, I can get into this state with just my app running). I am not experiencing this problem on any of the other Android phones (including Eris, Hero, and Droid).

The interesting thing is that if I kill my application, the phone is *still* very slow and sluggish. The only thing that seems to be able to get me out of this situation is a battery pull. If I run my application for about 3 hours, the phone starts to become very sluggish. Even simple operations like hitting the "home" button take many seconds. I'm not sure what to do at this point and am wondering where I can go from here.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved