decentraland / unity-explorer

Apache License 2.0
8 stars 11 forks source link

Profile are not properly disposed from cache #341

Open lorux0 opened 6 months ago

lorux0 commented 6 months ago

Currently DefaultProfileCache is going to grow the more profiles we get in runtime. This could lend into memory issues. Through the introduction of comms, we are going to fetch more profiles from peers. We need an implementation to dispose the unused profiles, for those users who has been disconnected, moved out from our room, etc. DefaultProfileCache already has some methods for removing profiles from the map, however we need to hook this calls into the domain's flow. Also, we should properly implement DefaultProfileCache.Unload(...) method. Another thing worth mentioning is that DefaultProfileCache.UpdateProfilingCounter() is wrongly implemented. We should fix this line, since the profile intentions are not the current profiles:

ProfilingCounters.ProfileIntentionsInCache.Value = profiles.Count;
pravusjif commented 2 months ago

Similar but not the same, related: https://github.com/decentraland/unity-explorer/issues/1433