How can I get the memory usage of a mesh?

if I use the function BABYLON.SceneLoader.ImportMeshAsync to download a mesh, then how can I get the download mesh size in bytes in the result?

I’m not sure what you mean by “download mesh size”? I don’t think we have something like that. At best we have the size of the whole file, but I don’t think we return it (as I’m not sure what it would be used for?).

1 Like

I has many 3d models to display in scene, and I want to keep memory usage under a specific limit otherwise the h5 app may be shut down by browser as a result of huge memory usage. So I need to know how much memory should I release before a 3d model created in scene.

If on windows, you can run task manager and look at Performance Tab under GPU - watch the summary at bottom. Otherwise, scene.debugLayer.show() might help

Unfortunately, it’s not possible to know how much memory is consumed by javascript code, the browser provides no API to do that.

performance.memory can give you the memory used by javascript, but it’s a non-standard extension provided by Chrome and Edge only…

1 Like