概述
Timeline: Activity_launch_request time:65620
04-14 15:31:25.347: I/dalvikvm(3483): Total arena pages for JIT: 11
04-14 15:31:25.621: D/dalvikvm(3483): JIT unchain all for threadid=13
04-14 15:31:26.371: W/dalvikvm(3483): threadid=1: spin on suspend #1 threadid=13 (pcf=0)
04-14 15:31:27.122: W/dalvikvm(3483): threadid=1: spin on suspend #2 threadid=13 (pcf=0)
04-14 15:31:27.122: I/dalvikvm(3483): "main" prio=5 tid=1 RUNNABLE
JIT unchain all for threadid=19
04-14 15:33:28.638: W/dalvikvm(5595): threadid=20: spin on suspend #1 threadid=19 (pcf=0)
04-14 15:33:29.388: W/dalvikvm(5595): threadid=20: spin on suspend #2 threadid=19 (pcf=0)
04-14 15:33:29.388: I/dalvikvm(5595): "pool-5-thread-2" prio=5 tid=20 RUNNABLE
运行应用过程中多次调用While(!isComplete); 对线程进行阻塞,导致线程资源占用过高。修改为一下实现方式可以降低资源占用
while(!isComplete){
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
Log.e(e);
}
continue;
}
转载于:https://www.cnblogs.com/inbase/p/5391736.html
最后
以上就是无限大米为你收集整理的Android While 循环导致的资源占用过高进而导致程序崩溃问题的全部内容,希望文章能够帮你解决Android While 循环导致的资源占用过高进而导致程序崩溃问题所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复