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

修复可能存在OOM的问题 #382

Merged
merged 1 commit into from Mar 22, 2020
Merged

修复可能存在OOM的问题 #382

merged 1 commit into from Mar 22, 2020

Conversation

ydq
Copy link
Contributor

@ydq ydq commented Oct 16, 2019

修复可能存在OOM的问题

#380

解决思路是使用LinkedHashMap的removeEldestEntry实现了一个类似于LRUCache的自定义LRUSet类来替代原来的HashSet类,LRUSet设定最大的容量(当前为128),当往set中put新数据超过了最大容量时,会自动删除不常用的记录,每一次contains判断都会激活一次记录,这样能保证在notStaticUri 中的URI都是一些最新的热点记录,又不会因为比如动态URL path导致的无限制增长

@hellokaton hellokaton merged commit d2a7c9b into lets-blade:dev Mar 22, 2020
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.

None yet

2 participants