MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

MRTK2 is overzealous in including irrelevant platform assets

Open keveleigh opened this issue 3 years ago • 0 comments

Describe the bug

Originally reported at https://forum.unity.com/threads/update-from-unity2019lts-to-unity2021lts-greatly-increased-memory-consumption.1338257/

It might be good to see if there's a way to more conditionally include parts of the main profile in specific platform builds, though I know we've run into serialization issues with this in the past.

Ultimately though, it would be good to ensure we don't get into this state with MRTK3! The rework of the monolithic profile will definitely help.

Additional context

We recently upgraded our project (Hololens 2) from Unity2019LTS (that used the Legacy XR system) to Unity 2021.3.10f1 (using the new XR plugin system and all recomended setting by MRKT2).

We noticed a big increase in memory consumption (~500Mb) at startup. The same Hololens2 app that used to take ~400Mb was now using ~900Mb at startup, which was pretty concerning.

For context, one of the causes was that MRTK2 using OpenXR was including other platform's controllers (material, textures, 3d models) in the Default Hololens2 Profile, as well as other unecessary things (for us). After we prunned things to target just Hololens2, it saved us >200Mb. Using the memory profiler, we now see just a slightly bigger "used memory" (~50MB) which we are ok with.

keveleigh avatar Oct 04 '22 21:10 keveleigh