com.unity.memoryprofiler 0.4.0-preview.1

com.unity.memoryprofiler

Notes: processedReleased August 31, 2021

Browse versions

PreviousNext

Unity Compatibility

Minimum Unity: 2019.4

Package Dependencies

Features

  • Added a collapsible "Memory Usage Overview" section containing a high level breakdown of the Memory usage.
  • - It shows the same breakdowns as the Profiler Window's simple Memory Profiler panel, adding two more categories which are untracked in the Profiler Window: Virtual Machine and Executable and DLLs
  • - It additionally shows a breakdown of Managed Memory usage into Virtual Machine (currently only available when using the Mono scripting backend), Objects and the two kinds of free reserved space, either in the Active Heap section, or as Fragmented Heap in older sections.
  • Note that Fragmented Heap Space can be reused for Managed Object memory, if new objects fit into contiguous free space in it. You can use the Fragmentation page to analyze your memory usage if you seem to have a lot of fragmented memory.
  • This breakdown should help you determine if it might be worth to dig deeper into Fragmentation or your Managed Object usage, or if there are other areas to focus on.
  • Added a collapsible "Top Issues" section containing some identified issues with the opened snapshot. On opening a snapshot, checks will be run and entries added to the list.
  • Note: There are a lot of memory usage scenarios that might be problematic but are not clear cut enough for an algorithm without any context of the project to make any determination on.
  • This list can therefore not be exhaustive but aims to offer a helpful start into memory investigations.
  • More checks will be added going forward. The current set of checks will add:
  • - A warning if the snapshot was taken from a Unity Editor, as memory usage in the Editor might be misleading compared to memory usage in a build.
  • - A warning if the System Allocator is used.
  • - An info entry if the snapshot was taken with some options for capturing disabled.
  • - A warning when comparing snapshots that were taken with different capturing options being enabled.
  • - An info entry when comparing snapshots taken from different sessions or an unknown session, as this will affect the detail level at which differences can be checked.
  • - An info entry when comparing snapshots taken from different Unity versions, as observed changes in memory could be due to the version change instead of a change in the project. The version numbers are shown if they are known.
  • Added a view selection Ribbon
  • - Renamed the Memory Map view to Fragmentation page.
  • - Moved all Table views into the new Objects and Allocations page.
  • - Renamed the Tree Map view to Summary page.
  • - This is an intermediate step in a larger UI refactor. In a next step, the Summary page will get new top level summary sections and the Tree Map view will be moved to the Objects and Allocations page.
  • Added an option to the drop-down of the Capture button to not take a screenshot on capture.
  • Added Virtual Machine memory as a category to Memory Map. This relies on changes made to the snapshot data and only works for any snapshots taken from Unity versions 2021.2.0a12, 2021.1.9, 2020.3.12f1, 2019.4.29f1 or newer. Only builds made against the Mono Scripting Back-end report Virtual Machine memory usage. IL2CPP does, as of yet, not report any of its Virtual Machine memory usage. This also addresses (Case 987987)
  • Added a Button to open the package's documentation to the top right corner.
  • Added a Menu button to the top right corner, containing an option to show the Memory Profiler's Preferences window.
  • Added a "Snapshot Window" Button to the top left corner to toggle the visibility of the open snapshots pane and the snapshots list.
  • Added the ability to set match row filtering for string based rows to check for exact (case-insensitive) matches additionally to the existing option to filter if it contains the searched string.
  • Added a replacement for the details view of the Profiler Window's Memory Profiler module. If the Package is installed, it will provide the UI for the Memory Profiler module for Unity versions of 2021.2 or newer.
  • Added a setting to `Preferences / Analysis / Memory Profiler / Replace Memory UI in Profiler Window` to toggle the Memory Profiler Module replacement on or off.
  • Added "All Native Allocations" table which lists the Memory Region, Area and Root Object names for each Allocation.

📈 Improvements

  • Changed the snapshot list UI by:
  • - Moving the open snapshots section to the top
  • - Adding a bar to break-down the total allocated memory vs. the systems maximally available memory to each snapshot (only works for snapshots taken form 2021.2.0a12, 2021.1.9, 2020.3.12f1, 2019.4.29f1 or newer)
  • - Grouping snapshots taken from the same session together and listing the project name along side them (only works for snapshots taken form 2021.2.0a12, 2021.1.9, 2020.3.12f1, 2019.4.29f1 or newer, older snapshots are grouped into the "Unknown Session")
  • - Moved snapshots options (Rename, Delete, Open Folder) into right-click context menu.
  • - Snapshots are now refereed to as "A" or "B" when comparing them.
  • Fixed table UI so that it no longer starts glitching when looking at tables of over 60000 rows.
  • Fixed an issue where the Memory Map would draw Native Objects over other Native Objects and over the end of their Native Region. The UI falsely assumed that an Object's memory is contiguous, starting from the address to the Object's header. In reality it may consist of several buffers and other allocations distributed across different memory regions. Right now, the memory reporting of Native UnityEngine.Objects is not detailed enough (broken down to each allocation) to clarify just where all of an Object's memory is residing. Current Native Objects being drawn in the Memory Map therefore is not 100% guaranteed to be showing the correct amount of contiguous memory owned by this object, but at least it no longer draws over other Objects or outside of the Region or Allocation it resides in. (Case 1278205)
  • Fixed Memory map colors for Objects and Allocations drawn outside of regions. (Case 1278203)
  • Fixed Memory Map to not draw anything or a white background outside of actual memory address usage. The pixels for these regions where no longer correctly cleared to full transparency.
  • Fixed Memory Map to not draw Virtual Machine memory as Managed Stack Memory in improbably high virtual address space. (Reporting of Managed Stack memory is not yet supported. Virtual Machine memory was miss-read as stack memory by the crawler.)
  • Fixed Memory Map Diff to draw lines correctly again as green, red, yellow or purple instead of drawing all lines as red.
  • Changed "Native Memory Regions" table to "All Memory Regions" table, naming Managed Memory Regions as either "Managed Heap Memory Section" or "Virtual Machine Memory Section" and showing this table in Memory Map details section when opting to look at Regions.
  • Changed Memory map to show the new "All Native Allocations" table when displaying allocations to provide more accessible information on the details of the allocations.
  • Changed "Import" button to use an icon instead of text and moved it to the right side of the toolbar.
  • Changed the link text for the Native Instance ID column to ping the object it belongs to, if the capture was taken from the current Editor session.
  • Clarified UI of the snapshot list to show more clearly which snapshots are open (Case 1129613)
  • Changed loading of Snapshot preview screenshots to happen asynchronously to speed up opening the window and rebuilding it after Domain Reload.
  • Improved Memory Map selection workflow, hinting that the table below it needs a selection to show anything and clarifying why there might be no data.
  • Fixed Memory Map deselection not affecting the view immediately.
  • Improved handling when taking a snapshot and waiting for the screenshot to be transmitted takes unusually long.
  • Fixed removing of sort filters via the 'x' button to actually remove the filter from the column.
  • Improved table names in the table view drop-down to format the amount of rows with thousand-separators.
  • Fixed filters to only use "Pretty Names" for the columns they apply to.
  • Changed Tree Map table to explicitly show the filters applied to the table when selecting a type block in the map. This also, for the first time, allows clearing the filtering after the first such selection was made.
  • Improved the Memory Module simple view in the Profiler Window (this package replaces the default one) by adding a scrollbar.
  • Fixed Tree Map to include 0B sized Native Objects in the count for objects of their Type.
  • Fixed match filter input field so it always gets the keyboard focus on adding the filter (Case 1359045)

API Changes

  • Removed support for Unity 2018.4. Old snapshots can still be imported but the package of the UI no longer works with 2018.4.
  • Removed the option to toggle off "Pretty Names" in the table views. It is now an unchangeable default.
  • Removed `Managed Global` from references list of managed objects.