Possible memory issue with model asset unloading

After manually unloading model asset (playcanvas generated glb from fbx upload) the usage of VRAM goes extremely up (instead of going down…).

For example:

  • manually loading GLB model asset via asset-registry load method
  • this GLB (asset size ~14MB) does about 13.3MB in VRAM
  • after unloading this specific via asset unload method, the VRAM goes extremely high (in this case 150MB)
  • repeating previous three steps leads to memory leak with gradually increasing the VRAM stats

I have tested this issue with multiple 3d models.

  • Native playcanvas profiler shows Vram.total: NaN after a while.
  • Using custom mini stats.

example project: PlayCanvas 3D HTML5 Game Engine
(feel free to clone)

  • pres A key to load the model
  • pres S key to unload the model
  • modify target asset on root entity, myLoader script

Thanks for all the details, I’ll investigate this next week.
I’ve created a tracking ticket: https://github.com/playcanvas/engine/issues/4531


I think, there is possibility of this being only the stats issue. While the stats are showing ~130MB, the graph looks just like on the beginning of the launch (empty or 0.2MB).


Thanks, looking forward

The fix is here

only reporting has been changed, behaviour is correct.