20-12-2023, 04:53 PM
Hello,
I noticed in my project some extreme frame drops, that seems to be linked to Obi, although even using the profiler it was extremely difficult for me to figure out why or where exactly. Those drops only happened if I had the Visual Studio debugger enabled. Always, and only, rendering it almost unusable.
Typically, I would run the game in Unity (with debugger) just fine until, seemingly randomly, each frame would suddenly start to take ~2000ms, for around 30s. Then the game would run smoothly again for 10s to 30s, before getting insane drops again, and so on. Those drops are *not* linked to any change of the code being executed.
The intensity of the issue instead seemed to scale with of much ObiSolver.SpatialQuery() I would overall use, as if each of them would lead to a delayed spike of garbage collection of some sort.
I finally I narrowed down the source of my misery to ObiNativeList.Dispose(), specifically those two lines:
Commenting those lines got me rid of the insane frame drops that I was getting every time I used the Debugger.
So the point of this post is to bring this to your attention, and then to ask you what are those lines about and if I can safely comment them without creating other issues.
I noticed in my project some extreme frame drops, that seems to be linked to Obi, although even using the profiler it was extremely difficult for me to figure out why or where exactly. Those drops only happened if I had the Visual Studio debugger enabled. Always, and only, rendering it almost unusable.
Typically, I would run the game in Unity (with debugger) just fine until, seemingly randomly, each frame would suddenly start to take ~2000ms, for around 30s. Then the game would run smoothly again for 10s to 30s, before getting insane drops again, and so on. Those drops are *not* linked to any change of the code being executed.
The intensity of the issue instead seemed to scale with of much ObiSolver.SpatialQuery() I would overall use, as if each of them would lead to a delayed spike of garbage collection of some sort.
I finally I narrowed down the source of my misery to ObiNativeList.Dispose(), specifically those two lines:
Code:
#if ENABLE_UNITY_COLLECTIONS_CHECKS
// dispose of atomic safety handle:
AtomicSafetyHandle.CheckDeallocateAndThrow(m_SafetyHandle);
AtomicSafetyHandle.Release(m_SafetyHandle);
#endif
Commenting those lines got me rid of the insane frame drops that I was getting every time I used the Debugger.
So the point of this post is to bring this to your attention, and then to ask you what are those lines about and if I can safely comment them without creating other issues.