Memory profiler die in unity 2022 3 LTS

Memory profiler not working under Unity 2022 LTS

my game started from 4 GB, when take a snapshot growing the memory up to 24 GB and then die the machine
‘Hold on’" forever

any idea? I need to close from win11, also I am in 4K, this is a probleme?

PS.: I tried with 1080p, same thing happened

Similar issue. Memory profiler eats up all the memory when trying to open any snapshot and eventually crashes the editor on 2022.2 and higher. No such issue in 2022.1. Tried on latest verified release version as well as the 1.1.0-pre.1 - no difference.

Hello you two,
Could you both please, if you have any crash callstack, provide that here, or if not, attach a debugger and while it grows out if control, hit pause and show the callstack of where this growth problem happens?

There is a chance that a fix to that is in the works but I want to double-check that, so that you don’t wait in vain and can file bug reports if needed so that we can fix any additional bug sooner?

1 Like

Do you mean callstack from Memory Profiler? What do you mean by “hit pause”? This happens when, in Edit mode, I’m clicking on a snapshot in the Memory Profiler window. It shows some progress for a while, then just stops at the “MouseUp” just like on the screenshot above and this is where memory starts to grow uncontrollably.

Curiously enough, today I managed to open a snapshot taken from a Windows build of a game built in 2022.3.0f1 in an empty project running the same version. Don’t know what happened, previously I was getting this memory issue in 100% of cases even when using an empty project to take snapshot. Maybe it has to do with something in the project being open in a Unity instance that is taking the snapshot (making corrupted snapshot or something)? Or maybe it’s platform related? Usually I work with snapshots from XBox build.

If I hit this wall again, I’ll try to let it crash and send you something.

On an unrelated issue, I wonder why Profiler says this if snapshot was taken with Unity 2022.3.0f1 (player as well as editor doing the capture)? Having a big issue with Untracked memory in the game, any additional insight this package can give me is gold.
9162527--1274810--upload_2023-7-21_17-23-26.png

yeah

In your IDE, while attached, you can pause the process and see what it is currently doing.

Hmm. I have a suspicion it could be related to forcing a synchronous search via SearchService and that maybe even triggering indexing of assets… This is use to find assets in the project and it is accidentally get statically initialized on snapshot opening. It was synchronous to stabilize the preview and Search and Find in project functionality but I guess it only reaaally needs to be done synchronously in our test suite. I’ll try adjusting it accordingly for the next release.

That detailed breakdown is only available in 2023.1+ versions, that tooltip is mistaken. Thanks for pointing this out. I’m fixing that too now.

2 Likes

I have a huge scene, naybe that is the issue. I have now 40 locations and a custom culling. I have 40 “sectors” and if the camera can see a sector, just activating, or disabling.

Now I have 48 GB RAM, and I don’t care anymore the shit editor memory issues.
I just do everything in 1 file.

Does it mean the player running the game must be 2023.1+ or the editor taking snapshot or editor that opens it?
Is there any chance this gets back-ported to 2022 LTS?

The only thing the Editor & package version that are taking and opening the snapshot are important for ATM is

  • (Editor version) what UI APIs (and therefore UI/UX affordances) are available (e.g. UI Toolkit’s Multi-column TreeView, which is used for the tables, is available in 2022.1+, making that the minimum version for the package)

  • (package Version) what parts of the data are read and how they are displayed in the editor, including but not limited to:

  • potential bugs, bug fixes and new extra processing steps in how that data is read and processed

  • Capabilities to be able to read data that was added to the reported data in-between package versions, i.e. if 2023.1.0a9/10(?) added data for per page Residency status, then a package version that shipped before that date would just not yet have the capability to read that info in. (Note that package finalization for in this case 2022.3 can happen somewhat in parallel to the next alpha so there’s a chance, albeit a small one, that a package version that shipped as part of a previous Unity version would already have that capability but in this case, you actually do need version 1.1.x and data reported from 2023.1.0a10+)

So, in contrast to that, the version of the Editor or Player that you connected the profiler TO defines the data set that will be included. And that usually is not backported, due to risks to the stability of that version.
(Exceptions apply like for 2018.4 we backported data changes, specifically because they were necessary to actually helped stabilize the capture process. #DefinitelyNotALawyer)

So TL;DR: the snapshot’s data must be reported to the capturing Editor from an Editor or Player of version 2023.1.0a10+ (maybe alpha 9, can’t remember definitively).

1 Like

FYI, one bug the issue on opening that you experienced might have been linked to is PROFB-156. The fix for that has landed in the package and will ship with the next package release. The same applies to the fix to my suspicion of SearchService initialization, and the tool-tip wording.

No ETA yet on when that version will ship. Hopefully soon ™ but there are other critical bugs that still need fixing as well.

To keep yourselves up to data and in case I forget to ping here on release, you can follow this thread to get notified on new releases of this package (as soon as we manually post to them and as long as we don’t forget), or follow the (not Unity Technology affiliated) @Needle_Mirror@twitter.com or @needlemirror@mastodon.gamedev.place bot accounts which monitor Unity’s package database and automatically post on every Unity Package release.

1 Like

Is it possible to change so when you click on the “Allocated Size” table column header, it sorts in descending order by default? 99% of time when you investigate memory you need to look at the biggest offenders… as of now I have to wait for a couple of minutes 3 times before being able to see useful info: when it first opens, when I click sort first time and the second time.

Should also probably remember my sorting settings next time I open this tab.

Also, ironically opening memory map table eats up a huge amount of memory (up to 30GB in my case), maybe there are more ways you can optimize to make it usable?

Or, for the love of god, just add export to CSV button for most data. Seems like every project has to go out their way to implement it themselves to get usable data from the Memory Profiler. And I’ve heard the newer versions made this harder with more complicated data structures…

As of now, Memory Profiler looks cool but only good for some very basic analysis. There should really be a way to just export this data into usable format without a lot of friction. Either CSV, or some easy to use documented API for iterating all the data so users can easily write exporters into their preferred destinations for proper analysis.