# How to get memory usage by model

**URL:** <https://forum.babylonjs.com/t/how-to-get-memory-usage-by-model/51825>\
**Category:** Questions\
**Created:** [July 5, 2024, 11:15am UTC](https://forum.babylonjs.com/t/how-to-get-memory-usage-by-model/51825 "2024-07-05T11:15:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neeraj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/neeraj/32/29497_2.png) [@Neeraj](https://forum.babylonjs.com/u/Neeraj)\
**Post date:** [July 5, 2024, 11:15am UTC](https://forum.babylonjs.com/t/how-to-get-memory-usage-by-model/51825/1 "2024-07-05T11:15:38Z")

</div>

Hi @all, I want to know how do i get the info about how much memory is used by the model?  
is it possible to get the detail of it like in this demo someone used?

> **[Babylon.js Playground](https://playground.babylonjs.com/full.html#YD2TXP%2323)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![Bhushan\_Wagh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bhushan_wagh/32/34147_2.png) [@Bhushan\_Wagh](https://forum.babylonjs.com/u/Bhushan_Wagh)\
**Post date:** [July 5, 2024, 11:23am UTC](https://forum.babylonjs.com/t/how-to-get-memory-usage-by-model/51825/2 "2024-07-05T11:23:26Z")

</div>

[https://gltf.report/](https://gltf.report/) this might help

---

<div class="post-metadata">

**Author:** ![Neeraj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/neeraj/32/29497_2.png) [@Neeraj](https://forum.babylonjs.com/u/Neeraj)\
**Post date:** [July 5, 2024, 11:27am UTC](https://forum.babylonjs.com/t/how-to-get-memory-usage-by-model/51825/3 "2024-07-05T11:27:02Z")

</div>

is there any other way also so i can generate form my side ?

currently I’m using gltf transform to generate the files but in that file there is no info about memory usage.

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [July 5, 2024, 12:39pm UTC](https://forum.babylonjs.com/t/how-to-get-memory-usage-by-model/51825/4 "2024-07-05T12:39:26Z")

</div>

With GLTF-Transform you may count textures VRAM with this snippet:

```auto
        let totalVRAM = 0;

        doc.getRoot()
            .listTextures()
            .forEach((tex) => {
                const vram = ImageUtils.getVRAMByteLength(tex.getImage()!, tex.getMimeType());
                totalVRAM += vram!;
            });

```

---

<div class="post-metadata">

**Author:** ![Neeraj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/neeraj/32/29497_2.png) [@Neeraj](https://forum.babylonjs.com/u/Neeraj)\
**Post date:** [July 8, 2024, 3:51am UTC](https://forum.babylonjs.com/t/how-to-get-memory-usage-by-model/51825/5 "2024-07-08T03:51:52Z")

</div>

I’m using the gltf cli, is there any other way to get the result using the cli or should i have to write code for it?

---

<div class="post-metadata">

**Author:** ![Bhushan\_Wagh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bhushan_wagh/32/34147_2.png) [@Bhushan\_Wagh](https://forum.babylonjs.com/u/Bhushan_Wagh)\
**Post date:** [July 8, 2024, 5:37am UTC](https://forum.babylonjs.com/t/how-to-get-memory-usage-by-model/51825/6 "2024-07-08T05:37:51Z")

</div>

gltf transform cli gives the analytics, try that [https://gltf-transform.dev/](https://gltf-transform.dev/)

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [July 8, 2024, 10:19am UTC](https://forum.babylonjs.com/t/how-to-get-memory-usage-by-model/51825/7 "2024-07-08T10:19:07Z")

</div>

GLTF-Transform CLI gives the GPU size for each texture but doesn’t count the total sum.

```auto
 gltf-transform inspect somefile.glb --format=csv

```

You may grab csv and count the total from it.  
Or remake inspect.ts to get the desired info - [glTF-Transform/packages/functions/src/inspect.ts at a99ff403ba976a05374369556119d76ed555a329 · donmccurdy/glTF-Transform · GitHub](https://github.com/donmccurdy/glTF-Transform/blob/a99ff403ba976a05374369556119d76ed555a329/packages/functions/src/inspect.ts)  
Or write your own function just for this purpose, as here - [https://glb.babylonpress.org/](https://glb.babylonpress.org/)
