Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.07k stars 1.15k forks source link

[Bug] ARFoundation 4.x Startup problem and Memory #595

Closed weacw closed 4 years ago

weacw commented 4 years ago

Describe the bug image

Launch: If you don’t check the box, the AR algorithm cannot be started on the device even though AR-Session components are instantiated. However, in version 3.1.3, it is allowed to start the AR algorithm without checking the instantiated AR-Session component.

Memory: I'm using the UAAL with iOS, The memory no change, always 500M when I call the Application.Unload() and Destroy all AR components.

image

Subsystem: When I stop and destroy the subsystem, it is invalid to recreate and enable it.

Smartphone (please complete the following information):

mdurand42 commented 4 years ago

Hello. Can you tell me why you wish to Destroy the subsystem in this case? Ideally you should allow XR Management to handle the creation and destruction of the subsystems.

weacw commented 4 years ago

Hello. Can you tell me why you wish to Destroy the subsystem in this case? Ideally you should allow XR Management to handle the creation and destruction of the subsystems.

Thank you for your reply!

I m using it in the uaal. unload the unity view and set session gameobject.activate to false the memory no reduction. But I destroyed the subsystem and reduced memory.

I want to know how XR Management creates and destroys subsystems manually.

Thank you!

tdmowrer commented 4 years ago

Disabling an AR***Manager (or the GameObject it is on) disables the subsystem, but it doesn't destroy it. You may be looking for LoaderUtility.Deinitialize.

weacw commented 4 years ago

Disabling an AR***Manager (or the GameObject it is on) disables the subsystem, but it doesn't destroy it. You may be looking for LoaderUtility.Deinitialize.

Thank you for your reply!

I m using this https://docs.unity3d.com/Packages/com.unity.xr.management@3.2/manual/EndUser.html#automatic-xr-loading It's work for me