decentraland / unity-explorer

Apache License 2.0
8 stars 11 forks source link

RendererPipeline - Performance spikes #1953

Open NickKhalow opened 1 month ago

NickKhalow commented 1 month ago

Issue Description:

These spikes occur in random time running the game. It happens both in the editor and the build.

image (21) image (20)

STR:

  1. Launch build/editor with profiler
  2. Run around the world for ~5 mins and look at your charts

Additional Notes:

Occured on Mac, M1 Pro

m3taphysics commented 5 days ago

Can you investigate to see if this happens for you @QThund ? You can now access profile builds here too: https://github.com/decentraland/unity-explorer/actions/workflows/build-profile-nightly.yml

QThund commented 4 days ago

It's the Garbage Collector. I've checked all the threads, there is one big allocation every now and then but the sum of the allocations of all the threads does not equal the total. There is a discrepancy between what the profile shows in the objects hierarchy and what it shows in the Memory chart. This allocation coincides with a big deallocation. For example, it grows in 230Kb, and releases around 20Mb. Allocated memory grows slowly due to SceneRuntime processing of CRDT messages (take a look to SceneRuntime.CrdtSendToRenderer thread in the profiler).

Image