Search Unity

ARWorldMap.TryDeserialize memory contraints

Discussion in 'AR' started by sharkapps, Jan 30, 2020.

  1. sharkapps

    sharkapps

    Joined:
    Apr 4, 2016
    Posts:
    145
    Hello,

    I am trying to reload an ARWorldMap that is 11,052,419 bytes in size. The app appears to run out of memory or just crashes while executing ARWorldMap.TryDeserialize.

    Setting up the worldmap seems fine - i can detect the whole floor, place prefabs, and save everything, but I am unable to load the map when creating a new session.

    If anyone knows of any tricks to get a map of this size loaded, I would much appreciate the help!
     
  2. sharkapps

    sharkapps

    Joined:
    Apr 4, 2016
    Posts:
    145
    After debugging further, I found that wrapping all of the NativeArray work, including the TryDeserialize call in an unsafe block fixed the problem.