VisionOS xcode debug error message

I get some errors while debugging in Xcode, how do I fix them or can I just ignore them? Unity6000.0.29+“com.unity.xr.visionos”: “2.1.2”

  1. NSBundle file:///System/Library/Frameworks/GameController.framework/ principal class is nil because all fallbacks have failed
  2. nw_socket_initialize_socket [C1:2] setsockopt SO_NECP_CLIENTUUID failed [22: Invalid argument]
  3. nw_socket_initialize_socket setsockopt SO_NECP_CLIENTUUID failed [22: Invalid argument]
  4. nw_socket_copy_info [C1:2] getsockopt TCP_INFO failed [102: Operation not supported on socket]
  5. nw_socket_copy_info getsockopt TCP_INFO failed [102: Operation not supported on socket]
  6. Hand anchors can only be queried when the hand tracking provider is running.
  7. We shouldn’t see any double-precision matrices – they are filtered up front.
  8. [NetworkComponent] Trying to process with outdated syncable that has already been unbound, guid=12660871485051251566
  9. Execution of the command buffer was aborted due to an error during execution. Insufficient Permission (to submit GPU work from background) (00000006:kIOGPUCommandBufferCallbackErrorBackgroundExecutionNotPermitted)
  10. WARNING → applicationDidReceiveMemoryWarning()


memory used in editor profiler

You should be able to safely ignore all of those messages, except the last one. I’ve seen most of these for normal apps (even non-Unity apps) and although they’re annoying they’re otherwise harmless.

WARNING → applicationDidReceiveMemoryWarning() means that you’re using a lot of memory, and if you use too much more the OS will kill your app. Is your app getting killed? Otherwise, is there any other symptom to the problem that you’re seeing?

Yes, initially, I placed a relatively complex scene models and used around 1000 textures with a resolution of 2048 pixels. While debugging in Xcode, a memory overflow alert popped up, and the app was killed.
Later, I adjusted most of the textures to 512 or 1024 in the texture import settings. Now, I get this warning message, but the application runs normally, with only slight frame stuttering in certain perspectives.

Does visionOS have its own memory management strategy? This scene runs smoothly in the Unity editor on a Mac Mini with 16GB of memory. The last picture I posted is the memory usage in the unity editor.

Yes. visionOS and iOS don’t page out to disk, whereas macOS and other desktop OS’es will. In other words, macOS will use the SSD or HDD to handle data that doesn’t fit into RAM, but visionOS does not. macOS will never kill your app as long as there is free disk space. visionOS and iOS kill apps when they use too much memory. I usually see this happen around 10-12GB in practice, but there’s no fixed amount that you can rely on. It depends on what other apps are running at the time, among many other factors. The best you can do is to either make sure you test throughly to ensure your app does not get killed, or to implement a lowMemory callback to unload resources if you start getting memory warnings.

Thank you for your reply. I will recheck the memory usage through Xcode. Currently, it seems that the texture files are taking up the most memory. After switching to ASTC 12x12, I noticed a significant reduction in memory usage.

Using texture compression will surely help, but I’m also kind of surprised that you have a need for 1000 2k textures… all at once? Are you using Resources.Load or Resources.LoadAll to load these textures? If so, that could be unnecessarily loading them all into memory. You may have a better time trying Addressables for managing a large library of texture assets at runtime.

In any case, you should expect to run into serious issues if your app needs more than 10GB of memory to function on visionOS. Any small leak or unexpected spike could cause the OS to kill your app, and I have to imagine it’s pretty slow to load if it needs to put all of those textures in memory upfront.

Because I have two large 3D Art scenes and have used a lot of materials, I wanted to take a shortcut by directly placing everything in the scenes instead of using AssetBundles or Addressables. If memory issues arise later, I will switch to distributed loading. :sweat_smile: Thank you again for your reply.

1 Like