Our game is suffering from intermittent freezes every other couple of seconds. After taking a look at the CPU Profiler and the Call Stack, blocks of GC.Alloc() and GC.Collect() caused by Lua.IsTrue(string) seem like the "culprit".
Screenshots
I created some sort of manager to limit the number of calls to this function per frame since many of those aren't frame-critic, and I did reduce the number of calls per frame from +20 to 5 (a value chosen by me), but it still keeps causing freezes.
How can I keep checking for Lua conditions while avoiding the freezes?