Search public documentation:
UE3 Home > Performance, Profiling, and Optimization > Memory Usage and Profiling > Hot Spot Report Generation
- Hot Spot Report Generation
- Creating Raw MemLeakCheck Data
- Creating CSVs To Pull Data From
- Parsing For Overall Trending Data
- Parsing Individual Level CSVs
- Preparing 'Human-Friendly' Hot Spot Reports For Level Designers
- Items To Be Called Out
- Items To Avoid
- Preparing A Followup Hot Spot Report
- Long Duration Runs
- Cold Spot Reports
The below article explains how to create "Hot Spot Reports" for your level designers. These reports will be created by your QA department and are useful in identifying memory dips due to sub-levels streaming in and out. They will allow your LDs to better see which buckets are costing the most memory, and should allow them to optimize their levels to better fit in memory.
To get the raw data that we will use to plot the memory status for SP levels you will need to do the following:
- Load up UnrealConsole, and connect to the instance of the game that will be used for this test.
- Launch into DebugConsole executable in the build you intend to capture from.
- Load into the SP level you intend to do a capture for.
- Once in the level use the following command:
- Turn on
stat levelsto be able track when the P-level is going to change.
- Progress through the entire P-level and transition to next P-level.
- After 2 captures into the P-level that you transition into back out to the main menu and/or reboot.
- Always reboot before starting another level capture.
- The memleakcheck files will be created in the following folder, depending on the platform being profiled:
- For PC/UDK:
- For iOS (after backing up the documents directory to PC. See Deployment Tools for info on backing up the documents directory.):
- For PC/UDK:
- Each memleakfile will be parsed into a folder named after the level it was started in.
For example, if you began a capture in level-a, and progressed into level-b and level-c captures for this entire run would be in the level-a folder.
- Copy these memleakcheck files/folders into a location that can be reached easily.
- Launch the memleakcheckdiffer.exe from the following folder:
- In the MemLeakCheckDiffer, Choose
File > Openall Memleak files in a folder and sub-folders
- Browse, and Navigate to the folder where you placed your memleakcheck files.
- Wait for the folders to populate the MemLeakCheckDiffer.
- Once all of the folders have populated MemLeakCheckDiffer window, choose to
Generate Overall Report.
- CSVs for each level will be generated, and a GlobalSummary CSV will also be created.
- CSVs are located inside the folder that your MemLeakCheck files were placed.
- Open the GlobalSummary spreadsheet in Excel.
- To more easily visualize the content data, hide all of the rows outside of the following:
- Highlight these 5 rows starting with the bucket name and ending with the last value in the row.
- After they are selected, choose to
Insert > Line Graph.
- This will give you a quick glimpse of the state of each of the content buckets as well as overall memory trending on the level.
After you have an idea of where the dips are you will need to work to figure out which content buckets grew to cause the memory change to happen. This is a matter of finding the lowest memory value from a particular dip, and taking the values of the buckets from the dip and subtracting from it the value of the buckets before the dip began. This will allow you to easily tell which content buckets caused the most problems at this location. For example if the level had 10 MB of AnimSequence Class data before a dip, and once the dip begins it increased to 25 MB in this bucket the LD and other devs will know that something that required a lot of animation data was loaded here, and this to cause the level to go low on memory. This data should be included along with each dip whenever possible. Simply letting the LD know how much the content buckets changed along w/ the sub-levels that were loaded when a dip occurs can often be enough to allow them to work out what needs to be shifted around or what might need to be trimmed from the level.
When preparing a hot spot report for a level designer you need to keep in mind that you want to deliver as much actionable information as possible. This means they will need to know what was going on when the memory dipped. To this end we make sure to include a list of the new sub-levels that streamed in when the memory began to go lower. We also provide a bugit location that can take the LD directly to the area of the level before the dip occurs in order to allow them to look around at this location in the editor or in game to make they are familiar with what is going on here and how much might need to be changed. Below is an example of our hot spot reports:
Any large changes in a single bucket where a dip occurs is usually a good thing to call out. In many cases things like cinematics will cause certain buckets to go up a large amount because of bugs that are simple fixes like turning bake and prune on. It is always good to get all of the low hanging fruit such as this as quickly as possible.
When compiling a hot-spot report you will want to avoid calling out buckets that the LDs can't have an effect on. You also want to determine if there are any buckets that aren't giving actionable data. In the case of our tests Texture pool stats were not a valid bucket to look at for memory because of the way they were capped was different than what was being recorded.
Followup reports allows LDs to see how much improvement or decline has happened since they received the first memory report. It is important to send out a follow-up report when memory has improved (even when the memory is good enough that another report isn't necessary) to help the LD understand the changes they are making are having a positive impact. The ultimate goal is to get and keep the levels in memory, and having LDs looking forward to seeing how their level currently stacks up is a big part of making that happen.
Once enough levels are in memory it is time to begin doing longer duration memory runs on multiple levels. To do this you merely need to find a large stretch of levels without blockers and start the
domemleakchecking 30command and play as far as possible. We run with
reducepoolsizeduring these runs so we can get the longest stretch possible. Using this data you can compare the difference between the individual level runs and continuous runs to get a basic memory delta between the two. Looking at this delta will give you an idea of how much overhead you will need to start building into individual levels, and will help to locate any memory leaks that may be happening.
Once memory dips have been resolved, and the game is within memory constraints (and if time permits) a cold spot report system can be implemented. What this means is that the same process to gather memory over time is done, but now you will want to concentrate on what areas have room to add rather than need to cut back. Done early enough this will allow LDs to flesh out areas better that are well within memory constraints.