Skip to content

Will the memory usage increase with the number of discord servers? #1282

Answered by valzargaming
zengdongxu111 asked this question in Q&A
Discussion options

You must be logged in to vote

The short answer to your question is yes. The long answer is that it depends. We have added support via the CacheInterface to allow bot developers to set up their own Redis (or other interface-compliant tooling) to externalize the memory instead of using the AbstractRepository. We are also investigating ways that LRU policies can be enforced directly at either the AbstractRepository or Collection level (which the AbstractRepository extends), including the addition of a trait that overrides some of the behaviors. An example of such a trait might look like this:

<?php
namespace Discord\Helpers;

trait LRUTrait
{
    protected array $accessOrder = [];
    protected int|bool $capacity = 1000; /…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by valzargaming
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1281 on January 20, 2025 07:42.