Memory issues with lot of objects

Hi everyone,

I’m loading a lot of .obj files with with its corresponding .mtls. I found that the total memory allocated doing this process its ~200MB. using Chrome Dev Tools I found that almost the half part of that memory allocated resides in the strings, which I found very strange, and I see that all the .obj files are stored as an string, so my memory is huge in size.

Taking an snapshot from the memory tab in Chrome Dev Tools I have the following data:

As you can see, there’s 195MB allocated, 105MB of that, cames from strings, and the data that are stored as strings are all my .objs files.

I’m using OBJLoader from Three along with the MTLLoader.

I would like to know If there’s a better way to load this geometry data. I have in mind to use .basis format for the image texturization in order to obtain better results in performance.

I’m interested to know how It works the .buf file format, and If there’s a method in three that I can use. I found that kind of format file in the following question in the forum: How to load 3D models with big size?

How can I obtain these .buf files from my .objs? Is there any better alternative to my issue?

Thank you all for your time!

We generally recommend using glTF/GLB models (with GLTFLoader). OBJ files tend to be large and slow because they are use plain text. glTF/GLB is binary and can be uploaded pretty directly to the GPU. See three.js docs. glTF files can also use compressed or quantized mesh data and Basis (.ktx2) textures (see gltfpack, gltf-transform).

1 Like

Thanks for your reply!

Using glTF objects instead OBJ files it is going to be a good way to deal with my problem.

But I’m interested in the .buf files also. I saw that some other pages uses It for geometry data (along with .basis format for the textures). Do you know how can I obtain that .buf data and If there’s a way to load It from three js?

Thank you!

Sorry, I’m not aware of a standard 3D format that uses a .buf suffix. Those might be files with custom binary data (“buffers”) designed for the specific website.

1 Like

Got It, thanks for your time!