Although Scaleform 3.0 originally introduced detailed memory reporting as part of Scaleform Player AMP HUD, profiling functionality has now been moved into a stand-alone AMP application, which can remotely connect to both PC and console Scaleform applications. For details on using AMP, please refer to AMP User Guide.
The HUD UI has been removed from Scaleform Player to make it more lightweight, but a memory report may still be generated and sent to the console by pressing (Ctrl + F5) keys. This report is one of the possible formats generated by the Scaleform::MemoryHeap::MemReport function:
void MemReport (class StringBuffer& buffer, MemReportType detailed, bool xmlFormat = false); void MemReport (struct MemItem* rootItem, MemReportType detailed);
MemReport generates a memory report, possibly formatted in XML, written to a supplied string buffer. This string can then be written to the output console, the screen, or a file for debugging purposes. The MemReportType argument can be one of the following:
MemoryHeap::MemReportBrief – A summary of the total memory consumed by the Scaleform system, as shown in the following example:
Memory 4,680K / 4,737K
Image 1,052 Sound 136 Movie View 1,739,784 Movie Data 300,156
MemoryHeap::MemReportFull – This memory type is what the Scaleform Player outputs when pressing (Ctrl-F6). It includes a system memory summary and individual heap memory summaries, and if SF_MEMORY_ENABLE_DEBUG_INFO is defined, it also includes a breakdown of the memory allocated, by stat ID. An example of the information given by heap is as follows:
Memory 4,651K / 4,707K
System Summary
System Memory FootPrint 4,832,440
System Memory Used Space 4,775,684
Debug Heaps Footprint 12,884
Debug Heaps Used Space 5,392
Summary
Image 1,052
Sound 136
Movie View 1,715,128
Movie Data 300,156
[Heap] Global 4,848,864
Heap Summary
Total Footprint 4,848,864
Local Footprint 2,427,860
Child Footprint 2,421,004
Child Heaps 4
Local Used Space 2,417,196
DebugInfo 120,832
Memory
MovieDef
Sounds 8
ActionOps 80,476
MD_Other 200
MovieDef 36
MovieView
MV_Other 32
General 91,486
Image 92
Sound 136
String 31,425
Debug Memory
StatBag 16,384
Renderer
Buffers 2,097,152
RenderBatch 5,696
Primitive 1,512
Fill 900
Mesh 4,884
MeshBatch 2,200
Context 15,184
NodeData 15,160
TreeCache 13,220
TextureManager 2,336
MatrixPool 4,096
MatrixPoolHandles 2,032
Text 1,232
Renderer 13,488
Allocations Count 1,822 MemoryHeap:: MemReportFileSummary – This memory type generates the memory consumed by file. The report sums the values per stat ID for the MovieData, MovieDef, and all MovieViews for each SWF. The format can be seen below:
Movie File 3DGenerator_AS3.swf
Memory 1,956,832
MovieDef 152,664
CharDefs 39,848
ShapeData 1,716
Tags 73,656
MD_Other 37,444
MovieView 196,249
MovieClip 120
ActionScript 181,917
MV_Other 14,212
General 1,596,712
Image 960
String 2,783
Renderer 7,464
Text 7,464MemoryHeap::MemReportHeapDetailed – This memory type is what AMP displays in the memory tab, and is the most detailed report, showing how much memory is used by each heap, how much is used for debug information, and how much is claimed by Scaleform but is currently unused. For example:
Total Footprint
Total Footprint 4,858,148
Used Space 4,793,972
Global Heap 2,405,492
MovieDef 80,720
Sounds 8
ActionOps 80,476
MD_Other 200
MovieView 32
MV_Other 32
General 92,566
Image 92
Sound 136
String 31,276
Debug Memory 8,192
StatBag 8,192
Renderer 2,182,960
Buffers 2,097,152
RenderBatch 5,696
Primitive 1,512
Fill 900
Mesh 4,884
MeshBatch 2,200
Context 15,184
NodeData 15,016
TreeCache 13,136
TextureManager 2,336
MatrixPool 8,192
MatrixPoolHandles 2,032
Text 1,232
Movie Data Heaps 300,156
MovieData "3DGenerator_AS3.swf" 300,156
MovieDef 152,664
CharDefs 39,848
ShapeData 1,716
Tags 73,656
MD_Other 37,444
General 141,332
Image 960
String 2,312
Movie View Heaps 1,727,936
MovieView "3DGenerator_AS3.swf" 1,727,936
MovieView 195,977
MovieClip 120
ActionScript 181,645
MV_Other 14,212
General 1,467,668
String 471
Renderer 7,464
Text 7,464
Other Heaps 360,580
_FMOD_Heap 360,580
General 359,944
Debug Data 12,884
Unused Space 51,292
Global 51,292
_FMOD_Heap 4,384
MovieData "3DGenerator_AS3.swf" 5,356
MovieView "3DGenerator_AS3.swf" 33,032As mentioned above, when Scaleform is compiled with SF_MEMORY_ENABLE_DEBUG_INFO, the memory system marks allocations with “stat ID” tags that describe the purpose of those allocations. A brief description of some stat ID categories follows: