i’ve been getting this error due to my game passing its memorystore usage. i use memorystore for my leaderboards which update every minute but its been like that for months so i don’t think that is the reason. it started happening after i added queues and now its causing this error:
the queue leader is one server that handles the queues. it checks all players in a queue every 3 seconds but since this error has been poping up, no one is in a single queue so how could this be happening if it checks through 0 items. pressing queue returns this error even though all im doing is using :SetAsync on a SortedMap
what are you talking about when you say queue? Do you mean the memorystore queue and why would you need that for a leaderboard
according to the documentation i think you should have enough storage for the sortedmap (1.2 KB / player), but how much data specifically are you storing for each player?
and how long is the expiration date? The number of players that have played within that time might be too much greater than the number of active players, which makes the memory quota not enough
queue, as in matchmaking. im using sortedmap and storing a tiny bit of information such as:
local success, err = pcall(queueStore.SetAsync, queueStore, key, {
Value = value,
PartyMembers = partyMembersId
}, expirationTime)
the PartyMembers depends if they are in a different party and not their own. so if they weren’t in a party or are in their own party, it would be nil to reduce the amount of data but if they were in a party, it would be a ordered table full of userids
Roblox’s MemoryStore quota works like this: you get 64KB + 1.2KB per player currently in your game. When players join, the quota goes up immediately. But here’s the catch, when players leave, the quota doesn’t drop for 8 whole days
Solution
Fix your expiration times. Since your queue checks every 3 seconds, queue data doesn’t need to live for days. Set queue items to expire in like 60-300 seconds max when using :SetAsync()
After processing queue items, call :RemoveAsync() instead of waiting for expiration. Same with leaderboards, if you update every minute, old entries can expire in 2-5 minutes;
The core problem is old data from when you had more players is still eating up memory quota even though those players are long gone. Shorter expirations and manual cleanup will fix this completely
Check what expiration time you’re setting when calling :SetAsync() on your queues and leaderboards. If you didn’t set one, or set it too high, that’s the issue
Also, you can’t manually clear this old data easily because MemoryStore HashMaps and SortedMaps don’t have a “get all keys” function. The data just has to expire naturally, which is why your graph shows it staying high even with no active usage
Ah okay, 20 minutes is way too long for matchmaking queues . That’s the problem right there
Think about it, if someone joins a queue, waits 10 seconds, then leaves or finds a match, their entry still sits in MemoryStore for the full 20 minutes. Over months of operation with tons of players joining and leaving queues, you’ve accumulated thousands of these expired entries that are still eating memory quota
actually, i don’t think queues are the problem, ever since i made monthly leaderboards, its always been taking over 50% of the memory store usage. i use it for each leaderboard and since there is 2 monthly leaderboards and atleast over 1 million different people who played the game, it doubles it so i think thats probably why