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

如果存储满了,如何控制内存 #32

Open
spiderT opened this issue Apr 10, 2020 · 3 comments
Open

如果存储满了,如何控制内存 #32

spiderT opened this issue Apr 10, 2020 · 3 comments
Assignees
Labels
discussion Something needs to be discussed

Comments

@spiderT
Copy link

spiderT commented Apr 10, 2020

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@spiderT spiderT added the enhancement New feature or request label Apr 10, 2020
@BuptStEve BuptStEve added discussion Something needs to be discussed and removed enhancement New feature or request labels Apr 10, 2020
@BuptStEve
Copy link
Member

你指的是 storage 不是内存吧?

目前的策略比较简单,每分钟遍历一遍把过期的数据删掉。
还没想好怎么把各种策略(比如FIFO、LRU)集成进来。

@spiderT
Copy link
Author

spiderT commented Apr 10, 2020

指的是 storage。
实际项目中可能有人把过期时间设置的很长,以至于不能及时清除数据,导致存储满了。
目前工作的项目中,计划当storage存储使用大于一个值后,采用FIFO,或者按过期时间远近两种策略清除缓存,不太确定的是什么时候计算storage使用量比较好,如果每次存的时候计算,会不会太频繁了。

@BuptStEve
Copy link
Member

我想想...
在 storage 里存这样一个数据:每条记录的保存时间,过期时间,上次使用时间、大小等信息。
基于这个数据就可以做一些策略控制?

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

No branches or pull requests

2 participants