Potential Memory leak on Image Detection example scene

Issue category: Unity Example Package
Device type & OS version: iPad Pro (11 inch) (2nd Generation) iOS 15
Host machine & OS version: Mac Monterey 12.5
Issue Environment : On Device
Xcode version: 13.4.1
ARDK version: 2.2.0
Unity version: 2020.3.33f

Bug reproduction steps:

  1. Create a blank Unity project
  2. Import ARDK 2.2.0 and ARDK Examples
  3. Follow setup tutorial to build for iOS
  4. Open the ARDK Examples folder and add the “Scene Selector” followed by the “Image dection” scenes into the build settings.
  5. Build project, open in Xcode and run on deveice
  6. (On device) Tap the ImageDection Scene to enter the image detection scene.
  7. (On Device) 5 finger tap to return to the “Scene Selector” scene.
    8 Repeat steps 6-7 until device crashes.

Hello Lightship community :wave:, I am building an application that Uses ARDK and more specifically Image Detection. I am building off of the Image detection scene provided in the ARDK examples. During some QA we noticed our app would crash if the Image dection scene was reloaded/enetered multiple times.

Ive managed to narrow this down to the Image Detection scene, as other AR scenes do not seem to have this issue. When looking in Xcode memory profiler we can see everytime the Image detection scene is loaded it adds around 200mb into memory that is never released.

This image is a result of me following the above steps

My questions are:

  1. Are extra steps needed to properly enter and leave the Image Detection scene? Currently im just using SceneManager.LoadScene(_sceneName); as per the Scene selector logic. Selecting “Manage Using Unity Lifecycle” On AR session manager doesnt seem to help either.

  2. Am I missing something obvious here, is this a known issue?

I have tried to do my due diligence regarding this issue and have not found other posts in discord or this forum (apart from one that was never resolved), so my apologies if this a mistake on my end.

Thanks for taking your time to look into this and I appreciate any discourse.

  • Ben

Hi @Ben_Monaghan!

There shouldn’t be any extra steps necessary for entering and exiting the Image Detection sample scene. Thank you for informing us of this – I’ve filed a report to notify the team of this issue.

1 Like