Reputation: 49
I have an app that I thought was working until someone tried to run it on an ultra-cheap tablet with very little memory. I am sure low memory is the problem but I have two questions: 1) am I doing anything that is consuming memory and 2) what to do when I run out.
This is my app architecture: My app comprises a main activity that calls, sequentially, many subsidiary activities to obtain user input. During the lifetime of the application, each subsidiary activity is likely to be called several times. Each subsidiary activity is invoked by a startActivityForResult call. When the subsidiary activity has done it's stuff, it will put any results into an Intent and call finish(). Back in the main activity, onActivityResult detects that the subsidiary activity has finished, processes the returned data then calls the next subsidiary activity.
Am I doing anything wrong here? Specifically, when I have finished with a subsidiary activity does all its data get cleared out of memory? If I call the same subsidiary activity again, do I have to do anything special to avoid getting duplicate copies of the activity's data loaded into memory?
Running my app on a low memory system is that I get the following messages in the Android Monitor:
"Low on Memory."
I then see up to seven occurrences of "Performing stop of an Activity that is not resumed" (What does that mean?)
"This window was lost"
Then another "Performing stop of an Activity that is not resumed"
"Exception when starting Activity. Android.os.DeadObjectException" (What's that?)
"This window was lost"
Then my app dies.
Is my diagnosis that this is a memory problem correct? Does my architecture lead to memory leaks? What can I do to rectify the problem?
Any help gratefully appreciated.
Kind regards Keith
Upvotes: 1
Views: 318
Reputation: 130
Upvotes: 0