coimbrastudios/framework

GC allocation on the Player Loop events service

Opened this issue · 0 comments

Framework Version

11.0.5

Unity Version

2022.3.30f1

Current Behavior

Player loop events are generating GC each frame, I've tried to cache the Loop events but this showed the same result as such its possible the allocations are related to the EventContext being created for the Invoke.

pre_gc_fix

Expected Behavior

EventContext being cached or pooled to avoid generating the allocations.

Steps to Reproduce

  1. Start an empty scene.
  2. Use the profiler in any frame.

Workaround

It's possible to deactivate the events when not using to avoid the allocations and GC generation.