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

Add heap max ratio and force trigger #31

Merged
merged 3 commits into from
Sep 29, 2020
Merged

Add heap max ratio and force trigger #31

merged 3 commits into from
Sep 29, 2020

Conversation

huannan
Copy link

@huannan huannan commented Sep 28, 2020

作者好,感谢作者大大的开源。发现一个小小的改进点,我试着将内存提升到90%多了,这时候GC比较频繁的,heapStatus.used >= lastHeapStatus.used条件不成立会导致策略命中次数清0。

而此时的内存已经很危险了,稍有不慎就会OOM然后应用直接Crash掉了,后面就没法触发trigger了,目前的策略对于这种情况无法处理。

我建议应该增加一种策略,大于85%小于95%用原来的策略,大于95%强制触发trigger。姑且将这个95%叫做最大阀值。这样可以覆盖更多的可能性情况。

@AndroidInternal
Copy link
Contributor

好建议,我看一下

Copy link
Contributor

@AndroidInternal AndroidInternal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有几条review意见

Copy link
Contributor

@AndroidInternal AndroidInternal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

又补充了2条,我没其他问题了 @alhah 再帮忙确认下

@AndroidInternal
Copy link
Contributor

done

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

Successfully merging this pull request may close these issues.

2 participants