It might be worth a shot. In 1.0 it might fail to load the managed bytes, in 1.1 it might instead take ages on parsing the fields of value types in managed arrays.
Did you give this a try?
sorry for never getting back, I was busy back at the time, and then forgot about it. Unfortunately, things got worse with last version of memory profiler (1.1.3). Now it’s again refusing to open at all, spinning like 5 minutes, writing disk full, and then crashing Unity. Sometimes I get the opportunity to still report a bug, which I now did (including the dmp, but excluding the project).
Is there any way to get back to the old memory profiler?
Is the Window refusing to open or does it take too long to take a capture or is the capture taken and it takes too long to open it? In the last case there is nothing getting written to disk (save for maybe the swap file if memory usage explodes. If you have a snapshot, that would still be greatly appreciated to have so we can analyze and fix this issue, as it’s now pretty clear that it was indeed distinct from the other issue I fixed.
(I.e. Thanks for filing a bug report now, but I’m not sure if a dmp without a snapshot or even a Project would give us even enough of a hint of where the issue occurs. It will also very likely get rejected by QA because it doesn’t give them anything to reproduce. If you post the IN-XXXX version here, I can at least have a peak at the dmp file to see if anything obvious stands out.)
You might still want to try that workaround of adding an early out in the 1.1.0 version of the package (or find the new place where that array crawling happens in 1.1.3 and cap it there). In the other case the issue was due to a set of very unproportional usage of managed arrays of structs (hundreds of billion entry arrays) and that isn’t just bad news for the Memory Profiler, that’s also terrible for memory fragmentation and Boehm performance at run time. So if you have such array usage, I’d strongly advice to switch to NativeArrays where possible.
You can use the package manager to add the package by name and there specify a version, or modify your Packages/manifest.json file, specifying any released version of the package. You can check the changelog for what the version numbers were.
it refuses to start at all, so I guess a snapshot would not help in that case. there’s just a modal unity window coming up for like 5 minutes, and then Unity crashes, I did not manage to see the memory profiler at all with latest version. I can try older versions, but due to the 5 -10 minutes wait every time I start it (and the crash also has effect on other running software) this is a time consuming process…
the case in Jira:
IN-89080
PS: I tried both 1.1.0 and 1.0.0 again:
1.1.0 also refuses to start
1.0.0 starts, but same old behavior: I can take a snapshot, but opening it leads to minutes of waiting. I implemented the hack you mentioned above, together with a logging statement, but this seems not to be the issue.
With going back, I mean is there a way going back to the old integrated memory profiler, which was part of the Unity profiler, not a separate package? I really need to be able to profile memory again at some point…
Oh, that callstacks actually does help point out the direction of where this issue is coming from. Something goes horribly awry while initializing quick search. In 1.1.3 that should be an async op, not a synchronous one, so I’m still a bit unclear why it would lock up.
What are your Quick Search (aka the Search window) settings? And can you use the Search Windows to search for something using the adb (asset database, not android debug bridge) search provider?
That looks reasonable enough. Try waiting until it is done indexing and opening the Memory Profiler then. maybe the fact that indexing hadn’t happened yet was the entire issue?
hmm does it still crash with the same callstack in the Editor.log?
Don’t know what the old one was, but here is the last one:
=================================================================
Native Crash Reporting
=================================================================
Got a UNKNOWN while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
=================================================================
Managed Stacktrace:
=================================================================
at <unknown> <0xffffffff>
at UnityEditor.HierarchyProperty:get_pptrValue_Injected <0x00069>
at UnityEditor.HierarchyProperty:get_pptrValue <0x0005a>
at <EnumerateInstanceIDs>d__4:MoveNext <0x000a2>
at <FetchItems>d__9:MoveNext <0x0088e>
at UnityEditor.Search.SearchEnumerator`1:MoveNext <0x000ea>
at UnityEditor.Search.SearchEnumerator`1:NextItem <0x00022>
at UnityEditor.Search.BaseAsyncIEnumerableHandler`1:FetchSome <0x00132>
at UnityEditor.Search.SearchService:HandleItemsIteratorSession <0x0043a>
at UnityEditor.Search.SearchService:GetItems <0x004d2>
at UnityEditor.Search.SearchService:GetItems <0x0005a>
at UnityEditor.Search.SearchService:Request <0x002ba>
at <RequestSearchAndAwaitResults>d__11:MoveNext <0x00062>
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000da>
at AsyncSearchHelper:RequestSearchAndAwaitResults <0x000da>
at <InitializeAsync>d__17:MoveNext <0x000e2>
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000d2>
at Unity.MemoryProfiler.Editor.QuickSearchUtility:InitializeAsync <0x000c2>
at Unity.MemoryProfiler.Editor.QuickSearchUtility:InitializeQuickSearch <0x0010a>
at Unity.MemoryProfiler.Editor.MemoryProfilerWindow:OnEnable <0x00102>
at System.Object:runtime_invoke_void__this__ <0x00087>
at <unknown> <0xffffffff>
at UnityEngine.ScriptableObject:CreateScriptableObjectInstanceFromType_Injected <0x0006c>
at UnityEngine.ScriptableObject:CreateScriptableObjectInstanceFromType <0x0002a>
at UnityEngine.ScriptableObject:CreateInstance <0x00022>
at UnityEditor.EditorWindow:GetWindowPrivate <0x000d2>
at UnityEditor.EditorWindow:GetWindow <0x00032>
at UnityEditor.EditorWindow:GetWindow <0x0004a>
at UnityEditor.EditorWindow:GetWindow <0x00042>
at <>c:<SetupView>b__27_3 <0x00022>
at <Module>:invoke_void <0x000a1>
at UnityEngine.UIElements.Clickable:Invoke <0x0002e>
at UnityEngine.UIElements.Clickable:ProcessUpEvent <0x0020a>
at UnityEngine.UIElements.Clickable:OnPointerUp <0x00104>
at UnityEngine.UIElements.EventCallbackFunctor`1:Invoke <0x000c3>
at DynamicCallbackList:Invoke <0x001cf>
at UnityEngine.UIElements.EventDispatchUtilities:HandleEventAcrossPropagationPathWithCompatibilityEvent <0x0160a>
at UnityEngine.UIElements.EventDispatchUtilities:DispatchToCapturingElementOrElementUnderPointer <0x0038a>
at UnityEngine.UIElements.PointerEventBase`1:Dispatch <0x000ba>
at UnityEngine.UIElements.EventDispatcher:ProcessEvent <0x000e6>
at UnityEngine.UIElements.EventDispatcher:Dispatch <0x00112>
at UnityEngine.UIElements.BaseVisualElementPanel:SendEvent <0x00082>
at UnityEngine.UIElements.UIElementsUtility:DoDispatch <0x0055a>
at UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent <0x000f2>
at UnityEngine.UIElements.UIEventRegistration:ProcessEvent <0x0008e>
at <>c:<.cctor>b__1_2 <0x0002a>
at UnityEngine.GUIUtility:ProcessEvent <0x001c9>
at <Module>:runtime_invoke_void_int_intptr_intptr& <0x00095>
=================================================================
Crash!!!
That looks pretty similar (minus mentioning AdbProvider and some native calls)… What version of Unity are you on? I suspect my colleagues working on search might have to take a closer look at this one… Having a repro project for that would be really good though ![]()
repro project will be impossible I guess, as the issue does not occur on a new project.
This is currently on 2023.2.20.
We have a fork of the project which is on 2022.3 LTS, but same issue there.
Is that because it is too big to upload with the bug reporter (QA can provide you with a link where you can upload it to) or because you can’t share the project?
Also, can you maybe try using the search window to search for “adb: T:MemoryProfilerWindow”? (it shouldn’t result in anything but that’s the search request the Memory Profiler kicks off to prepare the search index.
You’ll likely have to enable adb search context first, see the screenshot.
It’d be interesting to see if it finishes the search or crashes out of memory or something…
I did a search, and got no results, but then I was not able to turn on .adb; I don’t have the dialog that’s seen on your screen shot, and in the search settings the .adb settings are greyed out (see my screenshot above).
Project is both too big (>100GB) and also full of our own IP which we wouldn’t like to share.
That should be behind the three dot menu in the search window, i.e. under the top left corner of the white dropdown in the screenshot. Is that missing for you?
yes, not there in 2023.2.20; there were some bigger UI changes in 2023.2.x which did not make it to Unity 6 due to some bugs AFAIR.




