How Can Developers Analyze Unity Memory Usage and Reduce Crash Risks?
High memory pressure can push a game closer to device limits and increase the risk of crashes. GOT Online adds PSS GPU memory data, a dedicated memory usage analysis page, and heap object snapshots for IL2CPP packages to help developers examine memory usage in greater detail.
New users can get 2 hours of free GOT Online testing time after completing registration. https://www.gameoptim.com/?fopt=blog Summary GOT Online adds PSS GPU memory data to complement PSS memory data and help developers monitor potential crash risks. The new Memory Usage page provides an overview of memory usage, resource memory analysis, and resource object snapshots. Developers can analyze memory trends across resources such as textures, meshes, animations, and audio. Heap object snapshots are now supported for IL2CPP packages, providing additional information for optimizing heap memory allocation. Resource data collection in Overview mode can introduce significant performance overhead, so developers should consider the test configuration when analyzing runtime performance. Why Is Memory Management Important for Unity Games? Memory management is a critical part of game development. When a project experiences high memory pressure during runtime, it can approach the memory limits of the target device and increase the risk of crashes. To help developers understand memory behavior more comprehensively, GameOptim has expanded the memory related data available in the latest version of GOT Online. The update includes: PSS GPU memory data A dedicated Memory Usage page Resource memory usage analysis Resource object snapshots Heap object snapshots for IL2CPP packages These additions provide different levels of visibility into overall memory usage, resource memory, and heap memory allocation. How Does PSS GPU Memory Help Developers Monitor Memory Pressure? GOT Online adds a PSS GPU memory trend to the Runtime Information page in Overview mode. GPU memory refers to memory used by rendering resources while the project is running. The value is reported by the underlying graphics driver and includes memory allocated for resources such as textures and meshes, as well as memory allocated by libraries used to process these resources. When GPU memory usage is high, the risk of a device crash can increase, making it an important metric to monitor. Why Can PSS GPU Memory Show Step Like Changes on Android 10 and Android 11? Due to underlying system limitations on Android 10 and Android 11, PSS GPU memory is refreshed only once every five minutes after the device starts. As a result, the PSS GPU memory curve on these devices can appear as a series of steps. This behavior can also cause the PSS memory shown in a report to appear to increase sharply at a particular frame. When investigating the reason for such an increase, developers should therefore trace back to events that occurred during the previous five minutes rather than focusing only on that frame. What Can Developers Analyze on the New Memory Usage Page? GOT Online adds a Memory Usage page under the memory analysis module in Overview mode. The page provides a quick overview of memory usage across different resource categories and helps developers narrow down which resources may be contributing to memory pressure. This reduces the need to investigate individual resource categories one by one. What Memory Trends Are Available in the Memory Usage Table? The Memory Usage table can display: PSS memory Reserved Mono Resource memory usage When Lua testing is also enabled in Overview mode, the table can additionally display Lua heap memory usage. These memory curves can help developers quickly assess whether the project may have a memory leak. The resource memory usage curve represents the total memory usage of all resources collected by the GameOptim SDK during the test. By default, the table displays three curves: PSS memory Reserved Mono Resource memory usage Resource object snapshot frames are also marked on the horizontal axis. When Does GameOptim Collect Resource Memory Samples? By default, the GameOptim SDK triggers data sampling at several points during a test: Test start Every 1,000 frames Scene changes Test end Manual resource object snapshots using the Dump operation Only manual resource snapshots collect detailed information about all resources in the current frame. What Happens When Resource Testing Is Enabled in Overview Mode? When Resource testing is enabled together with Overview mode, the GameOptim SDK collects detailed information about individual resources during runtime. To control the performance impact of data collection, different resource categories are sampled on different frames. As a result, the resource memory usage shown in this configuration is a simulated aggregate curve with a step size of 60 frames. Its accuracy is relatively lower, so the curve is hidden by default. Developers should also be aware that enabling Resource testing together with Overview mode can introduce significant performance overhead, potentially causing lower frame rates and stuttering during the test. Therefore, this configuration is not recommended for comprehensive runtime performance analysis . How Can Developers Analyze Resource Memory Usage by Category? The Resource Memory Usage table provides more detailed memory information for 11 resource categories , including: Textures Meshes Animations Audio The table allows developers to observe memory trends for different resource categories and quickly determine which type of resource is contributing most to memory pressure in different scenes. This provides a more efficient starting point for resource memory investigation. How Do Resource Object Snapshots Help Identify Memory Problems? Developers can select a resource snapshot frame in a report without Resource mode enabled, or select any frame in a report with Resource mode enabled. The page then displays: A preview pie chart showing the proportion of different resource types Detailed resource information for the selected frame The Resource Object Snapshot module provides a quick overview of how memory is distributed across resource categories at a specific frame. The table on the right lists resource categories in descending order of memory usage and provides: Resource count Memory usage Recommended value Memory usage that exceeds the recommended value is highlighted in red, making it easier to identify resource categories that require further investigation. How Can Developers Drill Down into Specific Resource Usage? The operation column in the Resource Object Snapshot table provides direct navigation to the corresponding resource tab in the Resource Memory page. From there, developers can further investigate how individual resources are being used. The Resource Memory page also marks resource object snapshot frames. Selecting a snapshot frame displays the detailed information available for the resources at that point in the test. What Does the New Memory Analysis Workflow Provide? The updated memory analysis capabilities provide several levels of investigation: 1. PSS and PSS GPU memory help developers monitor overall memory pressure and potential crash risks. 2. Memory Usage provides an overview of PSS, Reserved Mono, resource memory, and, when configured, Lua heap memory. 3. Resource Memory Usage helps identify which resource categories contribute to memory pressure. 4. Resource Object Snapshots provide detailed information about resource counts and memory usage at specific frames. 5. Heap Object Snapshots for IL2CPP provide additional information for investigating heap memory allocation. By moving from overall memory trends to resource level details, developers can narrow down potential memory issues more efficiently. FAQ What new memory analysis features are available in GOT Online? The latest version adds PSS GPU memory data, a dedicated Memory Usage page, resource memory usage analysis, resource object snapshots, and heap object snapshots for IL2CPP packages. What is PSS GPU memory? PSS GPU memory represents memory used by rendering resources during runtime, based on memory allocation reported by the underlying graphics driver. It includes memory associated with resources such as textures and meshes and related processing libraries. Why does PSS GPU memory appear as a step like curve on some Android devices? On Android 10 and Android 11, system level limitations cause PSS GPU memory to refresh only once every five minutes after the device starts. This can result in step like changes in the reported curve. What does the Memory Usage table show? The table displays PSS memory, Reserved Mono, and resource memory usage by default. When Lua testing is enabled in Overview mode, Lua heap memory usage is also available. Why is resource memory usage hidden by default when Resource testing is enabled in Overview mode? Different resource categories are sampled on different frames to control the performance impact of data collection. The resulting resource memory usage is a simulated aggregate curve with a 60 frame step size and relatively lower accuracy, so it is hidden by default. Can Resource testing and Overview mode be used for comprehensive performance analysis? Enabling Resource testing together with Overview mode can introduce significant performance overhead, potentially causing lower frame rates and stuttering during testing. Therefore, this configuration is not recommended for comprehensive runtime performance analysis. About GameOptim GOT Online GOT Online is a cloud based performance analysis platform with online performance reports for deeper analysis and collaboration. Based on visualized data display, providing targeted analysis suggestions and performance parameter trends, facilitating efficient quality control execution. To meet a wide range of optimization needs, GOT Online provides four major analysis modes: • Overall Performance Analysis • Mono Heap Memory Analysis • Lua Performance Analysis • GPU Performance Analysis