Either the graph is bugged or the limits are bugged here.
This is for our game yeet battles Yeet Battles - Roblox
Memory store graph is reporting that we are using 8125 bytes in our memory store.
Our memory store requests are failing with an out of memory error
Checking our game, the errors report a significantly higher memory usage than
A) The graph is showing
and
B) Should be possible with our current implementation of memory store
Luckily this is a feature in testing in case something like this happened, but this will prevent us from going live with the intended use case.
Our write implementation looks like
local FNV_PRIME_32 = 16777619
local FNV_OFFSET_BASIS_32 = 2166136261
local CommonUtils = {}
function CommonUtils.FNV1a16(str: string) : number
local hash_val = FNV_OFFSET_BASIS_32
for i = 1, #str do
hash_val = bit32.bxor(hash_val, string.byte(str, i))
hash_val = (hash_val * FNV_PRIME_32)
end
-- XOR fold to 16 bits
local foldedValue = bit32.bxor(bit32.rshift(hash_val, 16), bit32.band(hash_val, 0xFFFF))
return string.format("%04x", foldedValue)
end
function ActivePlayerMemoryMap.WriteAsync(userId: number, versionNumber: number)
assert(versionNumber > 0 and versionNumber <= 127, "Version number must be between 1 and 127")
local userIdHash = commonUtils.FNV1a16(tostring(userId))
local versionChar = string.char(versionNumber)
local success = false
local attempts = 0
while not success do
success = pcall(function()
activePlayerMemoryMap:SetAsync(userIdHash, versionChar, MAX_EXPIRATION_TIME)
end)
if not success then
attempts += 1
if attempts < RETRY_ATTEMPTS then
task.wait(1)
else
break
end
end
end
if not success then
warn("MemoryStore write failed after 5 attempts")
end
end
Meaning we are writing one byte to a maximum of 65536 total keys throughout a memory store hashmap.
This SHOULD be impossible to hit limits with, as it is within the base limits. Regardless, the analytics graph is showing we are only using 8125 bytes of memory store storage.
Root cause may have something to do with https://create.roblox.com/docs/cloud/reference/features/storage#Cloud_FlushMemoryStore as this was used to clear out a previously flawed implementation somewhat recently.










