Service · inherits Instance
SceneAnalysisService
About SceneAnalysisService
Provides programmatic access to the Scene Analysis tool's underlying performance data.
Methods 6
GetAnimationMemoryAsync
() → AnimationMemoryResultYieldsReturns loaded animation clip memory. The same asset shared by multiple Animators appears only once, with all owners listed.
Root dictionary
Key Type Description Namestring Always "AnimationMemory".Sizenumber Total loaded clip memory in bytes. Childrenarray Array of clip entries and optionally an out-of-data model group. Clip entry
Each child in
Childrenis either a clip entry or the "not in data model" group (see below).Key Type Description Namestring The asset ID (e.g. "rbxassetid://111").Sizenumber Clip memory in bytes. AssetIdstring The asset ID string (same value as Name).Ownersarray Array of owner entries for all Animators playing this clip. Owner entry
Key Type Description Namestring Full path to the owning Animator (e.g. "Workspace.NPC.Humanoid.Animator").ClassNamestring Class name of the owner (e.g. "Animator")."Not in data model" group
Clips from Animators held only by Lua (not parented in the data model) are collected into a single group entry.
Key Type Description Namestring Always "Not In DataModel".Sizenumber Sum of clip bytes in this group. Childrenarray Array of clip entries (same schema as above). Example
{ Name = "AnimationMemory", Size = 1048576, Children = { { Name = "rbxassetid://111", Size = 32768, AssetId = "rbxassetid://111", Owners = { { Name = "Workspace.Player.Humanoid.Animator", ClassName = "Animator" }, }}, { Name = "rbxassetid://444", Size = 65536, AssetId = "rbxassetid://444", Owners = { { Name = "Workspace.NPC1.Humanoid.Animator", ClassName = "Animator" }, { Name = "Workspace.NPC2.Humanoid.Animator", ClassName = "Animator" }, }}, { Name = "Not In DataModel", Size = 32768, Children = { { Name = "rbxassetid://555", Size = 32768, AssetId = "rbxassetid://555", Owners = { { Name = "Animator", ClassName = "Animator" }, }}, }}, } }GetAudioMemoryAsync
() → AudioMemoryResultYieldsReturns loaded audio asset memory, deduplicated by asset ID. Assets whose owners share the same parent are organized under that parent path — flattened when there is one child, nested when there are several. Assets whose owners span different parents appear as shared entries with an
Ownersarray.Root dictionary
Key Type Description Namestring Always "AudioMemory".Sizenumber Total loaded audio memory in bytes. Childrenarray Mix of flat entries, parent groups, and shared entries. Flat asset entry
Emitted when a parent has exactly one audio child.
Key Type Description Namestring Full instance path (e.g. "Workspace.Map.BGMusic").Sizenumber Asset memory in bytes. AssetIdstring The audio asset ID. Parent group
Emitted when a parent has multiple audio children.
Key Type Description Namestring Parent path (e.g. "Workspace.Map.SFX").Sizenumber Sum of child asset bytes. Childrenarray Array of flat asset entries (each with Name,Size,AssetId).Shared asset entry
Emitted when an asset's owners are under different parents.
Key Type Description Namestring The asset ID. Sizenumber Asset memory in bytes. AssetIdstring The asset ID string (same value as Name).Ownersarray Array of owner entries. Owner entry
Key Type Description Namestring Full instance path (e.g. "Workspace.Zone1.Ambient").ClassNamestring "Sound"or"AudioPlayer".Example
{ Name = "AudioMemory", Size = 5242880, Children = { -- Single audio under unique parent (flat) { Name = "Workspace.Map.BGMusic", Size = 2097152, AssetId = "rbxassetid://111" }, -- Multiple audio under same parent (grouped) { Name = "Workspace.Map.SFX", Size = 1048576, Children = { { Name = "Workspace.Map.SFX.Explosion", Size = 524288, AssetId = "rbxassetid://222" }, { Name = "Workspace.Map.SFX.Gunshot", Size = 524288, AssetId = "rbxassetid://333" }, }}, -- Shared asset (owners in different locations) { Name = "rbxassetid://444", Size = 2097152, AssetId = "rbxassetid://444", Owners = { { Name = "Workspace.Zone1.Ambient", ClassName = "Sound" }, { Name = "Workspace.Zone2.Ambient", ClassName = "Sound" }, }}, } }GetInstanceCompositionAsync
() → InstanceCompositionResultYieldsReturns instance counts by category and class from the data model tree. Scans descendants of Workspace, Players, Lighting, MaterialService, ReplicatedFirst, ReplicatedStorage, ServerScriptService, ServerStorage, StarterGui, StarterPack, StarterPlayer, Teams, SoundService, and TextChatService. Each instance is classified into one of the categories below based on its class hierarchy.
Root dictionary
Key Type Description Namestring Always "InstanceComposition".Sizenumber Total instance count across all scanned services. Childrenarray Array of category entries. Category entry
Key Type Description Namestring Category name (see table below). Sizenumber Total instances in this category. Childrenarray Array of class entries. Class entry (leaf)
Key Type Description Namestring The class name (e.g. "Part","Script","Frame").Sizenumber Number of instances of this class. Categories
Category Representative Types 3D Objects BasePart, Model, Camera Physics Attachment, Constraint, JointInstance, WeldConstraint, ControllerManager, SensorBase UI GuiBase, BasePlayerGui, UIBase, ProximityPrompt, ClickDetector, TextChannel Lights Light PostProcessing PostEffect, Highlight, Atmosphere, Sky, Clouds Scripts LuaSourceContainer, BindableEvent, RemoteEvent, RemoteFunction Audio Sound, SoundEffect, AudioPlayer, Wire, SoundGroup, AudioEmitter Animation Animator, AnimationController, Animation, KeyframeSequence, IKControl Values ValueBase Character CharacterAppearance, Humanoid, HumanoidDescription, BaseWrap, FaceControls Textures FaceInstance, SurfaceAppearance, MaterialVariant Meshes DataModelMesh Particles ParticleEmitter, Fire, Trail, Beam, Explosion Services & Storage Player, Folder, Configuration Misc Tool, Backpack, Team, ForceField, PathfindingModifier, PackageLink, HapticEffect Unclassified Anything not matching the above Example
{ Name = "InstanceComposition", Size = 12450, Children = { { Name = "3D Objects", Size = 5200, Children = { { Name = "Part", Size = 3100 }, { Name = "MeshPart", Size = 1800 }, { Name = "Model", Size = 300 }, }}, { Name = "UI", Size = 2100, Children = { { Name = "Frame", Size = 900 }, { Name = "TextLabel", Size = 700 }, { Name = "UIListLayout", Size = 500 }, }}, } }GetScriptMemoryAsync
() → ScriptMemoryResultYieldsReturns per-script Luau VM heap memory usage in bytes. Scripts are grouped first by their containing service (derived from the first segment of the dotted path), then split into
"ModuleScripts"and"Scripts"subgroups based on the instance's class.Root dictionary
Key Type Description Namestring Always "ScriptMemory".Sizenumber Total Luau VM memory in bytes. Childrenarray Array of service category entries. Service category entry
Key Type Description Namestring Service name (e.g. "ServerScriptService","ReplicatedStorage").Sizenumber Sum of all script memory in this service, in bytes. Childrenarray One or two script-type group entries ( "ModuleScripts"and/or"Scripts").Script-type group entry
Key Type Description Namestring Either "ModuleScripts"or"Scripts".Sizenumber Sum of memory for scripts in this group, in bytes. Childrenarray Array of individual script entries. Script entry (leaf)
Key Type Description Namestring Dotted path to the script (e.g. "ServerScriptService.Shared.Utils").Sizenumber Heap memory used by this script, in bytes. Example
{ Name = "ScriptMemory", Size = 8388608, Children = { { Name = "ServerScriptService", Size = 524288, Children = { { Name = "ModuleScripts", Size = 409600, Children = { { Name = "ServerScriptService.Shared.Utils", Size = 204800 }, { Name = "ServerScriptService.Shared.Config", Size = 204800 }, }}, { Name = "Scripts", Size = 114688, Children = { { Name = "ServerScriptService.MainScript", Size = 114688 }, }}, }}, { Name = "ReplicatedStorage", Size = 262144, Children = { { Name = "ModuleScripts", Size = 262144, Children = { { Name = "ReplicatedStorage.SharedModule", Size = 262144 }, }}, }}, } }GetTriangleCompositionAsync
() → TriangleCompositionResultYieldsReturns triangle and draw call counts by render pass, sourced from
StatsServiceperformance data. Unlike other queries, this uses aSizesdictionary (withTrianglesandDrawcallskeys) instead of a singleSizefield. Render pass entries with zero triangles and zero draw calls are omitted.Root dictionary
Key Type Description Namestring Always "TriangleComposition".Sizesdictionary { Triangles: number, Drawcalls: number }— totals across all passes.Childrenarray Array of render pass entries. Render pass entry (leaf)
Key Type Description Namestring Render pass type (see table below). Sizesdictionary { Triangles: number, Drawcalls: number }for this pass.Render pass types
Name Description Opaque Opaque geometry Transparent Transparent geometry Terrain Voxel/smooth terrain Grass Terrain grass decoration UI Screen-space UI Decal Decal rendering Cloud Volumetric clouds GenericPostProcess Generic post-processing SSAO Screen-space ambient occlusion DOF Depth of field Particles Particle systems Sky Skybox Shadows Shadow map rendering Undefined Uncategorized Example
{ Name = "TriangleComposition", Sizes = { Triangles = 245000, Drawcalls = 1200 }, Children = { { Name = "Opaque", Sizes = { Triangles = 180000, Drawcalls = 800 } }, { Name = "Transparent", Sizes = { Triangles = 25000, Drawcalls = 150 } }, { Name = "Shadows", Sizes = { Triangles = 30000, Drawcalls = 200 } }, { Name = "UI", Sizes = { Triangles = 10000, Drawcalls = 50 } }, } }GetUnparentedInstancesAsync
() → UnparentedInstancesResultYieldsReturns instances held by Luau but no longer in the data model, grouped by host script. Each unparented instance is traced back to the script that holds the reference.
Unparented instances that are flagged for garbage collection but not yet deleted are temporarily shown with a parent of
Unknown. This is a side effect of how garbage collection is intended to work and not indicative of any problems.Root dictionary
Key Type Description Namestring Always "UnparentedInstances".Sizenumber Total count of unparented instances. Childrenarray Array of host script entries. Host script entry
Key Type Description Namestring Script path (e.g. "ServerScriptService.Gameplay.Combat") or"(unknown)"if untraceable.Sizenumber Count of unparented instances held by this script. Childrenarray Array of class entries. Class entry (leaf)
Key Type Description Namestring Class name of the unparented instance (e.g. "Part","Frame","Sound").Sizenumber Count of unparented instances of this class from this host script. Example
{ Name = "UnparentedInstances", Size = 47, Children = { { Name = "ServerScriptService.Gameplay.Combat", Size = 30, Children = { { Name = "Part", Size = 22 }, { Name = "Attachment", Size = 8 }, }}, { Name = "(unknown)", Size = 17, Children = { { Name = "Frame", Size = 12 }, { Name = "Sound", Size = 5 }, }}, } }
SceneAnalysisService also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.