Meshing causing app freezes

Include the following details while filing a bug report (edit as applicable):

  • Issue category: Meshing
  • Device type & OS version: iOS iPhone 12 Pro Max
  • Host machine & OS version: Mac
  • Issue Environment : On Device
  • Xcode version: 13.1
  • ARDK version: 0.11.0 then updated to 1.0.1
  • Unity version: Unity 2021.2.0f1

Bug reproduction steps:

I’m finding that my game is silently freezing on the device after a few minutes. No errors or anything, it just freezes up. I’ve previously found that it seemed to be related to meshing and that reducing the “Target Frame Rate” (it’s currently at 10) in the ARMeshManager helped fix this in the past… but that doesn’t seem to be fixing it any more (even on versions of my code where it did in the past, which is odd… I get the feeling I might have just gotten lucky before and not had it trigger by not testing for long enough at points).

When going back through versions of my code, I’ve found that it seems to be related to when the ARDK moved from v0.0.9 to v0.0.10. When I switch my current project with all the latest code from the latest version of Lightship back to v0.0.9, the freezing doesn’t seem to happen.

I’ve also noticed that items generate much less frequently on the v0.0.9 mesh, so I wonder if that is preventing the issue — maybe less items is preventing it from crashing somehow… but I do have things in place to limit the number of items generated and still find the same freezing occurs.

Does anyone know if anything in particular changed around the meshing functionality between v0.0.9 and v0.0.10 which might require me to change how I generate items onto the mesh?

I’ve not received any errors coming up or anything like that (funnily enough, it’s why I originally raised this question on the forums - Best way to debug crashes?). Haven’t been able to find anything in particular yet about what’s causing the freezes no matter what I do, so help would be much appreciated!

Hi Patrick,
can confirm that meshing was actively being developed between version 0.9 and the current version of Lightship (1.0.1), so it’s possible that an issue was introduced at some point. Have you been able to generate a minimal project which reproduces the freeze?
If you can post that somewhere publicly we can see if we can repro the issue locally. And at least confirm whether it’s an issue with the ARDK or just an issue with how it’s being used.

Hi Kevin,

So far I’ve been able to get the default meshing sample here to run without any freezing: Niantic AR Development Kit (ARDK): Advanced Meshing Tutorial: Garden Chunks

So I’m slowly trying to add in each bit of functionality back into my project using that as a base to see whether something in particular is causing things to freeze up. Will let you know if I can spot what that is!


1 Like

It looks like I’ve found the culprit! Within my mesh chunk’s Update() call, I had a lookup which checked if a value was null and if so, requested info from another controller elsewhere. I’ve since adjusted it to instead receive an event when the game is ready to receive that info and it seems much happier now.

Not sure why the upgrade between the versions triggered it, but eventually it triggered a memory issue — potentially the mesh chunks were updating more frequently? Or more efficiently so my code was running more? Not sure!

If any developers reach this post when struggling with meshing causing freezing — check your Update() call and remove anything you don’t necessarily need in there, see if that resolves it :slight_smile: