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

aoputil fragment 弱引用 #90

Open
huxq17 opened this issue Sep 23, 2021 · 3 comments
Open

aoputil fragment 弱引用 #90

huxq17 opened this issue Sep 23, 2021 · 3 comments

Comments

@huxq17
Copy link

huxq17 commented Sep 23, 2021

image
弱引用的话是机不可靠的,如果对象没其他引用持有的话,gc触发了就会回收,可能无法达到复用的效果,频繁反射性能可能会变差,这块设计是没问题的么?

@YueJZJM
Copy link

YueJZJM commented Sep 23, 2021

@huxq17 这里使用弱引用,主要是解决 fragment 内存泄漏的问题

而保存 fragment 主要是为了采集 fragment 页面浏览的信息,如果 fragment 被销毁了,不会触发浏览,此处也不应该继续引用 fragment

@huxq17
Copy link
Author

huxq17 commented Sep 23, 2021

@YueJZJM 但这里的fragment是你们自己new的,和业务的fragment没关系,没有其他地方引用,gc一下就会回收。譬如说第一次new了一个,下次再用的过程中处罚了gc,又得重新new

@YueJZJM
Copy link

YueJZJM commented Sep 23, 2021

@huxq17 感谢建议,的确会有频繁创建的可能,我们内部再考虑考虑优化方案

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

2 participants