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)
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:
This happens both in studio and in a live game.
Workaround
N/A
Issue Area: Engine Issue Type: Other Impact: High Frequency: Constantly
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 .
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.
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.