Hi Creators!
As we work to eliminate out of memory (OOM) crashes and improve performance, we recently discovered that the way we track memory consumes a significant amount of memory and frame time itself. However, we also know this memory information is valuable, especially for those of you who have built custom telemetry systems.
Our solution is that we are going to disable memory tracking by default but enable it for a small, random subset of users for telemetry purposes. This change will impact anyone using APIs that return category-based memory statistics; i.e., GetMemoryUsageMbAllCategories
, GetMemoryUsageMbForTag
, and GetTotalMemoryUsageMb
. Those functions will still work, but they will return 0 for devices where tracking is disabled. We will provide you with a new API, MemoryTrackingEnabled
, to check if tracking is on to help you accurately collect memory usage information.
We plan to roll this out as follows:
Phase 1: Warning and Migration Period (Later This Week)
This phase is intended to help you update all code and review feedback on missed call sites without disrupting custom telemetry or similar workflows.
- The new API is live and can return
false
, but memory tracking will still run and memory-usage APIs will continue to report usage. - Warnings will appear in the DevConsole and MicroProfiler.
Phase 2: Android Disablement (End of This Month)
- Memory tracking will be disabled for most Android devices, except for a small, random sample set to support telemetry.
- For this subset of users, the API will return
true
, allowing memory statics to remain available.
- For this subset of users, the API will return
- The new API will return
false
, and memory-related functions will return0
, barring the enabled sample set.
Phase 3: Full Disablement (Date TBD)
- We are likely going to disable memory tracking on all platforms, but there is some internal investigation into if we could leave it on without a significant performance impact for some platforms. We will share details as we have more certainty. Adopting the
MemoryTrackingEnabled
check will ensure you’re prepared for all situations.
How It Works
Please be aware, this update will impact anyone using APIs that return category-based memory statistics, i.e., GetMemoryUsageMbAllCategories
, GetMemoryUsageMbForTag
, and GetTotalMemoryUsageMb
.
Before requesting memory information via Luau APIs, first call MemoryTrackingEnabled
to check whether memory tracking is active.
-
If the API returns
true
, you can reliably call other memory-related APIs, as they will return accurate category-based memory usage stats. -
If the API returns
false
, other memory-related APIs will return0
, and a warning that memory category counters are disabled will be logged to your DevConsole.
The DevConsole’s memory and MicroProfiler’s counters views are also affected.
If you explicitly enable the MicroProfiler, memory tracking will be enabled automatically for your next application session. This will allow you to see memory counters in both the MicroProfiler and DevConsole. If memory tracking was disabled for the current session, you’ll need to restart the application after enabling the MicroProfiler to see the data.
Note: The value of MemoryTrackingEnabled
remains consistent for a single session and is only potentially changed after restarting the Roblox client app.
Screenshot of the warning that appears in the MicroProfiler during/after Phase 2
Screenshot of the warning that appears in the DevConsole during/after Phase 2
Please let us know if you have any questions or feedback!
Roblox Engine Foundation Team
FAQ
What happens if I don’t update my code?
- Your code will still compile and run, but if you are on a device that does not have memory tracking enabled, GetMemoryUsageMbAllCategories, GetMemoryUsageMbForTag, and GetTotalMemoryUsageMb will return 0, and you will see warnings in the console. Anything relying on results from these functions will not work as intended.
Will this change affect the performance analytics I see in the Creator Hub?
- No, this change will not impact the aggregated memory metrics displayed on your Creator Hub dashboards. Roblox will continue to collect the necessary performance data from the small, random subset of users where tracking remains enabled.
How can I debug my experience’s memory usage?
- You can still use the MicroProfiler to debug memory. When you enable the MicroProfiler, it will automatically force memory tracking to turn on for your next session, giving you access to all the memory counters you need. Remember to restart the client if tracking was already off. Luau memory usage view is not affected.