If the DOM is not working well for you, don't use the DOM. Use SAX, or perhaps the XmlPullParser, both of which are available in Android.
On Fri, Jul 1, 2011 at 1:18 AM, Steven Jeon <[email protected]> wrote: > Hi. > > I have an apk which is supposed to be operated in Honeycomb devices. > It requests some information to a server, receives replies in a form > of XML, parses the reply, and display the results. It works fine in > Android 3.0. > However, if I run the same apk in Android 3.1, I see (in DDMS) > consecutive garbage collection causing the information query extremely > slow. Follow is a sample log for the case. > > 06-24 19:20:38.140: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1224K, > 8% free 26384K/28615K, paused 28ms > 06-24 19:20:38.180: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1225K, > 8% free 26384K/28615K, paused 28ms > 06-24 19:20:38.220: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1226K, > 8% free 26384K/28615K, paused 26ms > 06-24 19:20:38.260: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1227K, > 8% free 26384K/28615K, paused 28ms > 06-24 19:20:38.300: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1228K, > 8% free 26384K/28615K, paused 28ms > 06-24 19:20:38.340: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1230K, > 8% free 26384K/28615K, paused 30ms > 06-24 19:20:38.380: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1231K, > 8% free 26384K/28615K, paused 28ms > 06-24 19:20:38.420: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1232K, > 8% free 26384K/28615K, paused 28ms > 06-24 19:20:38.460: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1142K, > 8% free 26430K/28615K, paused 28ms > 06-24 19:20:38.500: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1121K, > 8% free 26430K/28615K, paused 27ms > 06-24 19:20:38.540: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1144K, > 8% free 26430K/28615K, paused 28ms > 06-24 19:20:38.580: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1123K, > 8% free 26430K/28615K, paused 27ms > 06-24 19:20:38.620: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1147K, > 8% free 26431K/28615K, paused 28ms > 06-24 19:20:38.660: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1125K, > 8% free 26430K/28615K, paused 29ms > 06-24 19:20:38.710: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1149K, > 8% free 26431K/28615K, paused 28ms > 06-24 19:20:38.750: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1127K, > 8% free 26431K/28615K, paused 32ms > 06-24 19:20:38.790: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1151K, > 8% free 26431K/28615K, paused 28ms > 06-24 19:20:38.830: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1129K, > 8% free 26431K/28615K, paused 28ms > 06-24 19:20:38.870: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1153K, > 8% free 26431K/28615K, paused 29ms > 06-24 19:20:38.910: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1131K, > 8% free 26431K/28615K, paused 28ms > 06-24 19:20:38.950: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1155K, > 8% free 26431K/28615K, paused 28ms > 06-24 19:20:38.990: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1133K, > 8% free 26431K/28615K, paused 30ms > 06-24 19:20:39.030: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1157K, > 8% free 26431K/28615K, paused 28ms > 06-24 19:20:39.070: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1135K, > 8% free 26431K/28615K, paused 28ms > 06-24 19:20:39.110: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1159K, > 8% free 26431K/28615K, paused 29ms > 06-24 19:20:39.140: DEBUG/dalvikvm(21700): GC_FOR_ALLOC freed 1137K, > 8% free 26432K/28615K, paused 27ms > > I guess the garbage collection occurs due to the parsing of XML using > DOM. > What I want to know is why the collection does not occur in Android > 3.0. > Is there any differences between Android 3.0 and 3.1 regarding this? > Or am I missing something? > > Thanks. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training in London: http://bit.ly/smand1, http://bit.ly/smand2 -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

