Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

频繁下拉刷新出现anr #10

Closed
yihuajia opened this issue Nov 1, 2018 · 10 comments
Closed

频繁下拉刷新出现anr #10

yihuajia opened this issue Nov 1, 2018 · 10 comments

Comments

@yihuajia
Copy link

yihuajia commented Nov 1, 2018

无论是rxjava、还是hander那个适配器只要频繁下拉刷新必出现anr

@crazysunj
Copy link
Owner

你好,确定下anr的日志,它是队列请求的,不会出现这样的情况的!而且你在子线程处理,怎么会ANR呢?

@yihuajia
Copy link
Author

yihuajia commented Nov 1, 2018

肯定会的,必现。就好比上一次刷新还没有结束,然后再来一波刷新,所以当快速刷新的时候就GG了,在使用rxjava的时候cpu都是猛增。不过单次数据解析都要300ms.估计是可能跟我们后台的数据结构复杂度有关了

@crazysunj
Copy link
Owner

子线程不存在ANR,你把ANR日志发出来,我DEMO里面也有高频率请求,你可以把数据结构改复杂,或者加大数据量,放心测试!

@yihuajia
Copy link
Author

yihuajia commented Nov 1, 2018

没用的, demo那个也卡啊。不知道你有没有遇到过使用rxjava出现oom,我看你也用了Schedulers.computation()这个,但是实际效果不怎样。因为我之前也遇到过。出现ANR了是cpu使用率居高不下,有空可以给你拍个视频

@yihuajia
Copy link
Author

yihuajia commented Nov 1, 2018

子线程是不存在anr,这个没问题。但是刚好在要刷新界面的时候,又来一次下拉。如此反复就出现了。我也觉得这结构奇葩,测试过,光把Json字符串解析成对应的bean都得300ms,哎

@crazysunj
Copy link
Owner

我QQ387953660,有空就加一下,ANR日志发出来,分析一下!

@crazysunj
Copy link
Owner

json解析在子线程就没关系。

@yihuajia
Copy link
Author

yihuajia commented Nov 1, 2018

无论在哪解析都改变不了要300ms啊,回头加下你

@zhongjuncoder
Copy link

就算是在主线程,300ms也不至于ANR的

@crazysunj
Copy link
Owner

确实改变不了,但并不会影响主线程。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants