decentraland / unity-explorer

Apache License 2.0
8 stars 11 forks source link

Unable to recover initial memory state in GP #2129

Open dalkia opened 6 days ago

dalkia commented 6 days ago

(Tested in Mac)

Do the following steps

  1. Start out in Genesis Plaza and check out the memory.
  2. Teleport away to any given scene, and see the memory increase.
  3. Go back to GP and press the FULL button in the Memory debug window.

Memory should be about the same, but there is a clear difference. We have to find out why since this indicates there is a leak

Example in MAC

Initial state

image

Teleport to scene -145,69

image

Went back to GP and pressed FULL

image

Memory is now at around 8100MB vs 7700MB from start. There are an extra 400MB that shouldnt be there

QThund commented 3 days ago

It seems that it does not happen when teleporting between worlds (I mean, when not visiting Genesis).

QThund commented 2 days ago

Detected memory leaks, textures related to NFTs are not referenced by any object. Steps to reproduce:

  1. Enter Genesis.
  2. Go to Olavra.
  3. Go to Genesis.
  4. Go to Olavra. Take first snapshot with Memory Profiler.
  5. Go to Genesis.
  6. Go to Olavra. Take second snapshot.
  7. Compare both snapshots in Memory profiler. However, it does not happen always, sometimes textures are referenced by some objects.

Image

QThund commented 2 days ago

After Misha's changes (https://github.com/decentraland/unity-explorer/pull/2182) that situation should be solved. I tested it and references are tracked by the cache, so they can safely be freed once memory gets full.

QThund commented 2 days ago

Maybe a decision has to be made regarding whether those images should stay in memory when moving to another world or not.