Search Unity

ARFoundations Samples freeze

Discussion in 'AR' started by alloplastic, Jul 21, 2019.

  1. alloplastic

    alloplastic

    Joined:
    Jun 30, 2015
    Posts:
    18
    I'm seeing the same behavior on a Galaxy Tablet 3 and a Galaxy 7. Every ARFoundation sample scene I have run performs great for about 20 seconds, then it locks up, usually in an infinite loop cycling between the last couple of images captured by the camera.

    I'm guessing this might be a performance issue, on older devices. Are there things I can adjust in order to avoid this? I've tried dialing back the target framerate, for instance, and disabling visualizations.

    I just updated and retested with Unity 2019.1.10f1 and ARFoundation 2.1.1.
     
  2. alloplastic

    alloplastic

    Joined:
    Jun 30, 2015
    Posts:
    18
    UPDATE: I will confess that one cause of these crashes was an OpenCV sample I had integrated recently into my code. It was building a new Texture2D on the heap every frame.

    However, after fixing that, I did see the crash happening again after re-enabling the ARPointCloudParticleVisualizer code, but this is inconsistent. Sometimes the app runs fine for an extended period.

    Maybe the heap is being thrashed in a similar way by ARPointCloudParticleVisualizer. It manipulates a List and frequently allocates new arrays (which I believe hit the heap in .Net). Something I can work around or optimize for my particular application.