When I run my application on Android Studio, I read some GarbageCollection output:
05-11 16:18:20.973 12173-12183/com.example.myapp I/art: Background partial concurrent mark sweep GC freed 240546(10MB) AllocSpace objects, 1(20KB) LOS objects, 40% free, 46MB/77MB, paused 1.599ms total 121.211ms 05-11 16:18:54.304 12173-12183/com.example.myapp I/art: Background sticky concurrent mark sweep GC freed 419692(18MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 58MB/77MB, paused 3.022ms total 201.084ms 05-11 16:19:15.368 12173-12183/com.example.myapp I/art: Background sticky concurrent mark sweep GC freed 252567(11MB) AllocSpace objects, 0(0B) LOS objects, 14% free, 65MB/77MB, paused 1.955ms total 160.700ms 05-11 16:19:28.274 12173-12183/com.example.myapp I/art: Background partial concurrent mark sweep GC freed 554566(28MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 48MB/80MB, paused 1.916ms total 200.094ms
What does this mean? (I am reading large csv files with more that 70k lines in it)
Beginning with ART, Android has 2 allocation spaces: Non-large object space (Heap), and Large Object Space (LOS). The non-large object space is primarily for ordinary sized objects. The large object space is primarily for large objects (think bitmaps).
05-11 16:18:20.973 12173-12183
com.example.myapp I/art: Background partial concurrent mark sweep GC freed 240546(10MB)
The garbage collector has freed 240,546 objects, reclaiming 10 megabytes from the non-large object space.
AllocSpace objects, 1(20KB) LOS objects, 40% free, 46MB/77MB, paused 1.599ms total 121.211ms 05-11 16:18:54.304 12173-12183
The garbage collector has freed 1 object, reclaiming 20 kilobytes from the large object space.
Without reading the class or method which reads the CSV file it would be difficult to make an educated guess on why the Garbage collector is reacting in the manner displayed by the logs. But just looking at the trend in the logs, it appears the garbage collector is freeing up a large number of objects from the non-large object space while allocating little to nothing in the large object space.
References: http://developer.android.com/tools/debugging/debugging-memory.html#LogMessages
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With