Search Unity

When the AR module is frequently turned on/off, the memory usage is too large.

Discussion in 'Handheld AR' started by WellC, Aug 10, 2018.

  1. WellC

    WellC

    Joined:
    Mar 2, 2015
    Posts:
    48
    • Unity version : 2018.2.0f2(64bit)
    • ARPlugin: ARFoundation 1.0.0-preview .17 & ARKit XR Plugin 1.0.0-preview.13
    • Run device:iPhone6s
    • Device OS :iOS12 beta-5
    No ARKit.jpg Turn on ARkit.jpg
     

    Attached Files:

    Last edited: Aug 10, 2018
  2. 3d_Artist1987

    3d_Artist1987

    Joined:
    Jul 9, 2012
    Posts:
    710
    I facing also the same issue.
     
  3. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    518
    Are you saying ARKit uses more memory than expected, or that repeatedly restarting the session leaks memory? ARKit does require extra resources, although 100 MB seems like a lot. I tried toggling it on and off, and saw about a 20 MB difference, but no memory leaks.
     
  4. WolfBeardedLion

    WolfBeardedLion

    Joined:
    Apr 5, 2013
    Posts:
    27
    I have managed to get a variety of iOS devices to crash by turning the ARPlaneManager script off and on.

    You can test this by enabling the script when a touch is detected and then disabling the script when no touch is detected. After some tapping you will notice performance loss and screen flickering, and then the application will crash eventually.
     
  5. 3d_Artist1987

    3d_Artist1987

    Joined:
    Jul 9, 2012
    Posts:
    710
    Hey,

    Thanks for reply.

    App crashed with arkit 2 in iOS 12. Every time when I am using ar section it's increase memory.
     
  6. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    518
    Arkit 2? Which plugin are you using? This doesn't sound like the one delivered via package manager and compatible with ARFoundation.
     
  7. 3d_Artist1987

    3d_Artist1987

    Joined:
    Jul 9, 2012
    Posts:
    710
  8. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    518
  9. 3d_Artist1987

    3d_Artist1987

    Joined:
    Jul 9, 2012
    Posts:
    710
    Sorry for posting in the wrong post.
    Thanks for the reply.
    How to solve my issue?
    MY app crashing when memory reached a limit.
     
  10. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    518
    I'm not aware of any known issues related to this. Could you file a bug report and include the crash callstack? You might also try searching the ARKit specific forum.
     
  11. 3d_Artist1987

    3d_Artist1987

    Joined:
    Jul 9, 2012
    Posts:
    710
  12. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    18
    Thank you for your reply!
    --------------------------------------------------------------------
    I switched between 2 different scenes.
    A Scene: Normal scene
    |-MainCamear
    |-UICanvas
    |-Button: Load ARFoundtaion scene.
    |-Directional Light
    |-EventSystem
    B Scene: ARFoundation scene
    |-MainCamear
    |-UICanvas
    |-Button: Load Normal scene.
    |-Directional Light
    |-EventSystem
    |-AR Session Orgin
    |-AR Session
    |-Focus(Quad)
    ---
    This is my test record.

     
  13. 3d_Artist1987

    3d_Artist1987

    Joined:
    Jul 9, 2012
    Posts:
    710
    Hey,
    I am facing the same issue in arkit 2 from bitbucket.
    Which version of ios are You using? (Beta 12 or 11)
     
  14. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    18
    ARfoundtaion and ARKit 2.0(From bitbucket) has the same issue!
    My OS version is 12 Beta 8.
     
  15. 3d_Artist1987

    3d_Artist1987

    Joined:
    Jul 9, 2012
    Posts:
    710
  16. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    18
  17. 3d_Artist1987

    3d_Artist1987

    Joined:
    Jul 9, 2012
    Posts:
    710
  18. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    18
  19. WellC

    WellC

    Joined:
    Mar 2, 2015
    Posts:
    48
  20. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    518
    I haven't been able to reproduce it using ARFoundation and iOS 11.3. Perhaps it is specific to beta 12?

    Please submit a bug report with attached project that reproduces the issue, or let me know if there is an existing case number (I haven't seen one yet).
     
  21. jyves69

    jyves69

    Joined:
    Jan 3, 2014
    Posts:
    7
    Hi,
    we have some memory problem on ios12 too (but not with the AR-Kit)

    When we launch an empty application with unity on ios12 you loose 75MB relatively to the same application on ios11.

    Here the test we do with Unity2017.4.3f1 (up ios11, bottom ios12 beta 12) :

    EmptyProject_ios11_VS_ios12.png

    Do you have some informations about this problem ?
     
  22. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    518
    That seems more like a general iOS problem and not specific to ARKit. You might find an answer on the iOS forum or the Unity issue tracker. If not, please file a bug report.
     
  23. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    518
    Hi folks -- the memory leak on iOS 12 has been fixed in the ARKit XR Plugin version 1.0.0-preview.15.
     
    austin_unity382 likes this.
  24. WellC

    WellC

    Joined:
    Mar 2, 2015
    Posts:
    48
    Thank you!!! It's a good news!
     
  25. zhuty111

    zhuty111

    Joined:
    Nov 1, 2017
    Posts:
    2
    Hi the old ARKit plugin from AssetStore also have this problem ,the ARKit Plugin has been removed from AssetStore. I found it at https://bitbucket.org/Unity-Technologies/unity-arkit-plugin/ Our project has released,So if I use the ARKit XR Plugin version 1.0.0-preview.15 from the UnityPackage ,I have too much code to rewrite,So how can I solve this problem without using the ARKit XR Plugin version 1.0.0-preview.15?