The error happens when a server is unable to perform an allocation, and most of the time this happens when we need to make a single, large allocation after a process has run for a long time (and potentially fragmented the memory in a way that prevents the large allocation from “fitting” anywhere).
Depending on the situation we might not be able to fix this. Some thing you can try on your end (may or may not help), you can review objects that need a single, large allocation. The most common thing that would fall in to this category is a StringValue object storing e.g. a large JSON blob.
The next time you are in a server where this is happening, try viewing the server’s memory status. Is the used memory high (> 2gb)?
Interesting. I serialize server data in string values (containing a maximum of 199,999 characters of JSON data per string value object) as it’s more efficient than datastores. So if I was to split these segments into smaller values (for example 50,000 characters) it could potentially fix this issue?
Thing is when I reboot servers, they save fine for a while until running into issues again. Servers range in memory usage from 1-3GB. I may be pushing the limitations of Roblox, I’m not too sure.
I took a look at the flow for this function, there do seem to be one or to wasteful uses of memory in there, I will ask someone on the team to patch those. This may help, but it is not guaranteed to totally resolve the issue.