My Android app has a custom AsyncTask to make a rest call for a list of objects. I'm using Jackson to convert my response into Java and I am seeing about 30 garbage collections calls when mapping the Json via ObjectMapper.readValue(). Interestingly enough, if I make the same call a second, third, fourth time (by selecting a refresh button), there is only a single GC call. Any ideas why this is happening on the first call every time I start my Android App?
AsyncTask.java
doInBackground() {
HttpGet request = new HttpGet(url);
HttpClientUtil.setJsonAccept(request);
HttpResponse response = httpClient.execute(request);
HttpEntity responseEntity = new BufferedHttpEntity(response.getEntity());
// Call that garbage collect 30+ times the first exectution
ArrayList<MyObject> responseCollection = mapper.readValue(responseEntity.getContent(), new TypeReference<ArrayList<MyObject>>(){});
return responseCollection;
}
LogCat Output
07-10 11:05:13.484: D/dalvikvm(5518): GC_CONCURRENT freed 497K, 5% free 14030K/14727K, paused 3ms+4ms
07-10 11:05:13.484: D/dalvikvm(5518): GC_CONCURRENT freed 497K, 5% free 14030K/14727K, paused 3ms+4ms
07-10 11:05:13.484: D/dalvikvm(5518): GC_CONCURRENT freed 497K, 5% free 14030K/14727K, paused 3ms+4ms
...