[問題] WIFI Suspending all Thread及GC Freed問題

作者: mouse52055   2016-07-07 18:34:54
請問
我目前在做WIFI APP(TCP Socket)
接收資料的方式是在Thread中跑 while ((length = in.read(b)) > 0)
(in是BufferedInputStream)
但是我在執行時Log都會一直跑Suspending all threads took和GC freed,如下列Log,不曉得這樣在程式執行中是否會有影響?
W/art: Suspending all threads took: 15.001ms
W/art: Suspending all threads took: 5.784ms
W/art: Suspending all threads took: 35.113ms
I/art: Background partial concurrent mark sweep GC freed 205782(7MB) AllocSpace objects, 0(0B) LOS objects, 38% free, 25MB/41MB, paused 6.996ms total 60.501ms
I/art: Background partial concurrent mark sweep GC freed 208097(7MB) AllocSpace objects, 0(0B) LOS objects, 38% free, 25MB/41MB, paused 5.866ms total 53.566ms
I/art: Background sticky concurrent mark sweep GC freed 231047(8MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 25MB/33MB, paused 6.354ms total 85.863ms
會有多個Client連接近來,並每秒傳送20筆左右的資料(每筆 1412Byte)至APP做顯示功能
主要的問題是,(Suspending all threads took)和(GC freed),是否會影響App的流暢度,是否有解決的方法?已爬過網路上很多文章,但是還是不知道該怎麼解決。

Links booklink

Contact Us: admin [ a t ] ucptt.com