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

CQEngine can provide an expiration strategy to prevent the memory space from being used up #287

Open
clncon opened this issue Jul 29, 2021 · 4 comments

Comments

@clncon
Copy link

clncon commented Jul 29, 2021

I hope that CQEngine can provide some expiration strategies to prevent the collection from growing

@shenzhaoquan
Copy link

shenzhaoquan commented Aug 13, 2021

I also encountered this problem and added a simple implementation CapacityLimitedIndexedCollection @npgall
#289

@npgall
Copy link
Owner

npgall commented Aug 13, 2021 via email

@geezerrrr
Copy link

The best way to handle that is probably to add a timestamp in your objects which indicates the time it was added to the collection. Then define an attribute which reads that timestamp. Then add an index on that attribute. Then, you can write a query which retrieves objects which were added a long time ago, and remove those from the collection.

I don't think this is a good way, because we can't know when to clear them. It is possible that OOM occurred before I triggered the cleanup task.

In some cases, users cannot accurately assess how much data is entered into the CQEngine collection. This can easily cause memory overflow problems. A collection with limited capacity can better protect applications using CQEngine.

@npgall
Copy link
Owner

npgall commented Aug 17, 2021 via email

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

4 participants