Bug in MemoryStoreService SortedMap memory size quota

Reproduction Steps

  1. Insert a Script into ServerScriptService with the following code:
local MemoryService = game:GetService("MemoryStoreService")
print("Memory limit size test:")
local test = ""
for i = 1, 1020 do
	test = test .. "1"
end
print("Length of data being added: " .. tostring(#test))

local map = MemoryService:GetSortedMap("Map")

map:RemoveAsync("Test")
map:RemoveAsync("Test1")

map:SetAsync("Test", test, 86400)

test = ""
for i = 1, 1100 do
	test = test .. "1"
end

print("Length of data being added: " .. tostring(#test))

map:SetAsync("Test1", test, 86400)
  1. Run the server in studio, or publish the game and play it in the actual client (it affects both)

When you do this, you’ll see an error saying that the provided value is too long, even though the documentation states the following:

The size quota for a 1 player game is 65kb (64KB + 1KB ⨉ [number of users]), the total space taken up by the test code is around 2120 bytes (not including the json encoding characters, which is less than 65kb, obviously)

Expected Behavior
Value is inserted into the sorted map without issue, unless the memory size quota is actually full (65kb for 1 player).

Actual Behavior
“The provided value is too long” error:
35bc473f556b71c0fe654b20f34ce81607e3aa50_2_690x2341

This happens both in studio and in a live game.

Workaround
N/A

Issue Area: Engine
Issue Type: Other
Impact: High
Frequency: Constantly

3 Likes

Could you fix this please? This is still a big problem and hinders me from using MSS.

Unfortunately I doubt they will considering they updated the documentation and specifically put the limit at 1kb:

I am trying to find good work arounds to this limitation. And the only thing that comes to mind is breaking up the sorted maps into multiple maps, but that increases the amount of calls to the memorystore service, but it’s really the only option.

Regardless it looks like this limit will remain for the foreseeable future :frowning: .

Aside from making it more complicated for developers, it doesn’t lower the amount of data they have to store and only increases the number of requests to the service. I wonder what the motivation behind this is. :thinking:

1 Like

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

3 Likes

Hey do you have some news ? because i made a market and it can’t works goodly because of this Bug.

My module doesn’t work because of this either. Queues are useless right now and SortedMaps are limited to a ridiculously small limit.

that so sad but is it an issue or it will be everytime like that ?

Unless they say otherwise, it will stay this way forever.

To close the loop on this: the original issue was not with the overall memory quota but rather with the fixed limit on the value size in sorted map. Since then we’ve increased the value size limit to 32KB (Memory Store Sorted Map | Documentation - Roblox Creator Hub). The overall memory quota is still 64KB + 1KB ⨉ [number of users].

Hope this helps, don’t hesitate to start a new post if the issue remains.

2 Likes