Obi Official Forum
GC Alloc dropping FPS when rope gets bigger - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: GC Alloc dropping FPS when rope gets bigger (/thread-67.html)



GC Alloc dropping FPS when rope gets bigger - leonrdo - 08-08-2017

Hello guys, I have a situation here. I'm creating (extending) the rope at runtime. But from time to time, seems the GC is allocating memory and its causing the game to "lag" as the time to update the frame reaches up to 300ms. Follows the image of the profiler when the this happens. I'm not sure if theres a way to solve this problem, if its from the ObiSolver perspective or from Unity's GC perspective. Thanks in advance for some light in this issue.

[Image: zWmpQcb.png]


RE: GC Alloc dropping FPS when rope gets bigger - leonrdo - 09-08-2017

Another SS of this issue, with Memory profiler

[Image: ltGxrEV.png]


RE: GC Alloc dropping FPS when rope gets bigger - leonrdo - 15-08-2017

*bumpĀ 
Really need to know about this intense GC Alloc happening


RE: GC Alloc dropping FPS when rope gets bigger - josemendez - 15-08-2017

(15-08-2017, 03:09 PM)leonrdo Wrote: *bumpĀ 
Really need to know about this intense GC Alloc happening

The GC itself is not the main issue. The fact that your physics loop is executed 17 (!) times per frame is. Reduce your max fixed timestep in Unity's time settings, because you're hitting a spiral-of-death-type situation.

Also, to reduce the GC, check the amount of colliders you've added to the solver. Having too many colliders added to the solver increases the GC each frame. Your profiler clearly shows the collider update method is the culprit.