Skip to content

GC allocation on the Player Loop events service #3

@JeanLFraga

Description

@JeanLFraga

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions