Performance problems due to high RAM consumption
Performance problems due to high RAM consumption
Hi,
I'm using a .3ds mesh with 23290 triangles displayed by an OctTreeSceneNode as my game level. When the mesh is completly loaded into my program, it consumes about 330 megabytes of RAM, which is no problem for my machine, but for computers equiped with lower amounts of RAM. Why does Irrlicht need so much memory for a small 3ds file of 0,8 MB and textures of 10 MB? Is there any chance to optimize this?
I'm using a .3ds mesh with 23290 triangles displayed by an OctTreeSceneNode as my game level. When the mesh is completly loaded into my program, it consumes about 330 megabytes of RAM, which is no problem for my machine, but for computers equiped with lower amounts of RAM. Why does Irrlicht need so much memory for a small 3ds file of 0,8 MB and textures of 10 MB? Is there any chance to optimize this?
The fourth parameter of addOctreeSceneNode allows you to set the minimum number of polygons needed in each octree node. If you are using the default value (128 polygons) then because your mesh has quite a few polygons, the octree that is generated is going to be quite deep and require a lot of memory. Try setting this value to 512 or 1024 polygons to reduce memory requirements.
Thanks for your reply, I didn't thougt of that yet and just tried it out. I've also tried to use an AnimatedMeshSceneNode instead of an OctTreeSceneNode, but the lowest memory consumption I could achieve was still at about 323 MB.
Last edited by Homer on Fri Apr 09, 2004 12:33 pm, edited 1 time in total.
I've commented everything out, except the line
and the necessary lines, of course. The program still needs 300 MB of RAM. Would be nice if niko could have a look at this.
Code: Select all
levelMesh = sm->getMesh("map.3ds");
Irrlicht also does nasty stuff to md2's. Check out hellow world example it uses over 20 megs of memory for a 500k file.
The reason behind this is irrlicht is storing full vertex coords basicalyl for every frame (along with normals). The md2 format itself cuts out a lot of this and uses scalers and such to make each vert only 3 bytes. Irrlichts verts end up being more like 20 I think.
The reason behind this is irrlicht is storing full vertex coords basicalyl for every frame (along with normals). The md2 format itself cuts out a lot of this and uses scalers and such to make each vert only 3 bytes. Irrlichts verts end up being more like 20 I think.