GlobalDataStore:SetAsync() caches forever on new data stores

In the case that a data store is empty, calling SetAsync on it for the first time will increase the datastore/cache memory indefinitely.

Repro:

  • Create a new place and join in
  • Call GetDataStore on DataStoreService to access an empty GlobalDataStore
  • Call SetAsync on that data store with a key and some data, such as a string
  • Go to the server memory and look for datastore/cache - this will increase and nothing will bring it back down

Before:


After: (I only put a small amount of data)

Here’s a line of code that will do this for you:

game:GetService("DataStoreService"):GetDataStore("Test"):SetAsync("Test", "Test")

This is the current expected behavior. Datastore cache is size limited, when the datastore cache size exceeds the limit older entries will be freed.

We will look into improving this behavior.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.