在安卓游戏零星滞后 [英] Sporadic lag in Android game
问题描述
我正在用一个简单的Java的Android游戏。我注意到一些恼人的滞后每20-40秒。首先,我想他们我们被垃圾收集器造成的,但我检查了我的LogCat中我看到,有没有垃圾收集在游戏滞后时间。
标志着我的日志每次比赛begans落后,看到有几乎每次该日志条目:
I'm making a simple Android game with Java. I noticed some annoying lags every 20-40 seconds. First I thought they we're caused by the Garbage Collector, but as I checked my LogCat I saw that there's no Garbage Collection at the time the game lags. I marked the log everytime the game begans to lag and saw that there's almost everytime this log entry:
W / qdhwcomposer(209):过多的延迟阅读VSYNC:把47毫秒
W/qdhwcomposer(209): Excessive delay reading vsync: took 47 ms
,因为它说,有一个延迟时间(通常> 45ms),我认为这就是我看到的滞后。
有谁知道这个问题,或者如何避免这些延误?
As it says, there is a delay (usually >45ms) and i think that's what I notice as lag. Does anybody know this problem or how to avoid those delays?
搜索结果
以下是LogCat中2段在游戏滞后时间:
Here are two snippets from LogCat at the time the game lags:
07-29 15:11:50.196: D/BatteryService(692): update start
07-29 15:11:50.206: D/BatteryService(692): level:80, scale:100, status:2, health:2, present:true, voltage: 4121, temperature: 355, technology: Li-ion, AC powered:false, USB powered:true, Wireless powered:false, icon:17303554, invalid charger:0, online:4, charge type:1, current avg:460
07-29 15:11:50.206: D/BatteryService(692): Sending ACTION_BATTERY_CHANGED.
07-29 15:11:50.216: D/STATUSBAR-BatteryController(1082): onReceive() - ACTION_BATTERY_CHANGED
07-29 15:11:50.216: D/STATUSBAR-BatteryController(1082): onReceive() - BATTERY_STATUS_CHARGING:
07-29 15:11:50.226: D/HeadsetStateMachine(18054): Disconnected process message: 10
07-29 15:11:50.236: W/qdhwcomposer(209): Excessive delay reading vsync: took 47 ms
07-29 15:11:50.236: D/STATUSBAR-IconMerger(1082): checkOverflow(288), More:true, Req:true Child:5
07-29 15:12:00.176: W/qdhwcomposer(209): Excessive delay reading vsync: took 49 ms
07-29 15:12:00.226: D/BatteryService(692): update start
07-29 15:12:00.226: D/BatteryService(692): level:80, scale:100, status:2, health:2, present:true, voltage: 4065, temperature: 355, technology: Li-ion, AC powered:false, USB powered:true, Wireless powered:false, icon:17303554, invalid charger:0, online:4, charge type:1, current avg:460
07-29 15:12:00.226: D/BatteryService(692): Sending ACTION_BATTERY_CHANGED.
07-29 15:12:00.236: D/STATUSBAR-BatteryController(1082): onReceive() - ACTION_BATTERY_CHANGED
07-29 15:12:00.236: D/STATUSBAR-BatteryController(1082): onReceive() - BATTERY_STATUS_CHARGING:
07-29 15:12:00.236: D/HeadsetStateMachine(18054): Disconnected process message: 10
搜索结果
我与Android 4.3测试它在我的三星Galaxy S4(GT-I9505)BTW。
I tested it with Android 4.3 on my Samsung Galaxy S4 (GT-I9505) btw.
由于结果
杰鲁
Thanks
Geru
推荐答案
尝试调试使用的应用程序 - 的 http://developer.android.com/tools/debugging/debugging-tracing.html
Try debugging the app using -http://developer.android.com/tools/debugging/debugging-tracing.html
这篇关于在安卓游戏零星滞后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!