[Potential Action Required] An Update to Memory Tracking: Introducing MemoryTrackingEnabled API

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.
  • The new API will return false, and memory-related functions will return 0, 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 return 0, 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?

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.
91 Likes

This topic was automatically opened after 10 minutes.

Does this impact default Roblox Studio plugins? Or the MicroProfiler?

4 Likes

That unfortunately seems like the end of exploit detections based on client memory usage.

4 Likes

Why not just.. fix the API? Makes more sense than shutting it off all together.

34 Likes

Yeah, I’d hope that this a stopgap. It would be interesting to know how inefficient it was. I assume it’s not a small project to optimise if they’re doing all this rollout and migration stuff instead.

EDIT: This have confirmed that this is a temporary measure to mitigiate the performance impact of Memory Tracking until they are able to get a proper fix in place with a completely new and refactored system:

5 Likes

So just to clarfiy, after phase 3, we will still be allowed to enable to micro profiler to see memory right?

4 Likes

If I disable the microprofiler will it automatically disable memory tracking in my next session as well or will it persist for a certain stretch of time?

1 Like

its gonna be a great update like a great one
cause we use memory to detect exploiters so :slight_smile:

3 Likes

Is it possible to enable tracking when you open the microprofiler? Why does it have to be next session?

2 Likes

Is this really the best workflow a multibillion dollar company could come up with?

28 Likes

That was never a useful method

16 Likes

It needs to be the next session because many memory allocations were already performed with tracking disabled, and so were not tracked (i.e. the data would not be accurate). Additionally, memory tracking adds extra space to every memory allocation to perform memory tracking - but this extra space is not reserved when tracking is disabled.

The upside is that this means that for most sessions where memory tracking is disabled, we see not only a performance improvement, but also a reduction in memory usage.

Looking forward, we are investigating options to rewrite memory tracking in a way that reduces resource impact, but we do not yet have a viable design to accomplish this (let alone any idea on when it would be done). That’s why we implemented this solution - which we hope (but cannot guarantee) will be a stopgap solution.

7 Likes

I’m a developer (whom has no problem running Roblox) and I’d really prefer to always have access to memory tracking, for the sake of convenience. I reference them often. I’d hate to forget that I have to turn on the Microprofiler and restart the entire client every time I want to access those statistics.

How do I leave memory tracking on permanently? Is there an FFlag? If not, can we get one whitelisted?

9 Likes

Perhaps developers of an experience should have it enabled automatically, instead.

4 Likes

I have to disagree. Based on my experience it worked pretty well if applied properly and had small amounts of false flags.

Are there any % improvements you could share?
Would be curious on how much of an impact it has

8 Likes

It would be neat if tracking was enabled automatically in places that someone has edit access for, but never for normal players (for that place; unless they are part of the random sample for telemetry I suppose).

Partially related: Why can non-developers for some experience even open the dev console or microprofiler? It may be worth it to remove this ability altogether. Restrict opening these to people with edit access or declared as “testers” for the experience.

2 Likes

What you mentioned (enabling per-experience) was our ideal design, but to capture the benefits of turning off memory tracking, we unfortunately need to turn it off very early in the application lifecycle (before even starting the experience join). Additionally, there is no way to turn it back on once it’s off, so if you leave and join another experience, it would not be possible to re-enable in this case either.

2 Likes

The ability for regular players to use the developer console is crucial for us to receive proper bug reports, removing this would be catastrophic for us and make it almost impossible to debug scenarios that are hard to reproduce.

16 Likes