Reputation: 1641
I made a service and, looking at running services, I see that it takes 15MB of memory! Being it an overall simple service it seems really strange to me and so I wanted to know where to look at, in order to discover why so much memory is taken (note that I'm talking just about service, I made sure to close the activity)
Service's task is to periodically download rss feeds and update an sqllite db if a new article is present. As an internet connection is required service makes use of a network listener too. These are the attributes:
private Timer timer;
private MyDbHelper db;
private NetworkChangesReceiver networkListener; //a broadcast receiver for network state
private NotificationManager notifyManager;
private final NewsServiceB binder = new NewsServiceB();
private SharedPreferences prefs;
This is the binder class (in main activity I have a "check now" button, so I need a bindable service):
class NewsServiceB extends Binder{
public void downloadRss() throws IOException{
...
}
}
Upvotes: 0
Views: 108
Reputation: 36312
What you need is a memory analysis tool that shows you what is taking up memory. Take a look at this article from Google about memory analysis for Android. In particular look closely at the sections on MAT.
Upvotes: 2