Performance problems due to high RAM consumption

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Homer
Posts: 58
Joined: Tue Nov 18, 2003 7:11 pm
Location: Germany

Performance problems due to high RAM consumption

Post by Homer »

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?
Blivvy
Posts: 3
Joined: Thu Mar 18, 2004 1:03 am
Location: Hampshire, England

Post by Blivvy »

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.
Homer
Posts: 58
Joined: Tue Nov 18, 2003 7:11 pm
Location: Germany

Post by Homer »

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.
Blivvy
Posts: 3
Joined: Thu Mar 18, 2004 1:03 am
Location: Hampshire, England

Post by Blivvy »

Ah that's a shame :? . The only other thing I can suggest is trying the same with any triangle selectors you might be using. Is it definetly the node containing the level mesh that's consuming all your RAM? Good luck solving you problem!
Homer
Posts: 58
Joined: Tue Nov 18, 2003 7:11 pm
Location: Germany

Post by Homer »

I've commented everything out, except the line

Code: Select all

levelMesh = sm->getMesh("map.3ds");
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.
Guest

Post by Guest »

Weird. Does it matter at all if you run a Debug vs. a Release build?
Homer
Posts: 58
Joined: Tue Nov 18, 2003 7:11 pm
Location: Germany

Post by Homer »

Anonymous wrote:Weird. Does it matter at all if you run a Debug vs. a Release build?
Switching between Debug and Release makes no difference at all. It has to do with Irrlicht's mesh loader code, but that exceeds my humble c++ knowledge.
Domarius
Posts: 178
Joined: Thu Mar 11, 2004 9:51 am
Location: Brisbane, QLD, Australia

Post by Domarius »

We know Irrlicht can load .BSP files efficiently - is this the only documented case of loading a 3DS as a level and comparing the memory usage?
Caecus
Posts: 36
Joined: Fri Aug 22, 2003 6:33 am
Location: California, USA

Post by Caecus »

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.
Domarius
Posts: 178
Joined: Thu Mar 11, 2004 9:51 am
Location: Brisbane, QLD, Australia

Post by Domarius »

That actually sounds like a serious problem - how could anyone make a game run decently on anyones computer like that?
Domarius
Posts: 178
Joined: Thu Mar 11, 2004 9:51 am
Location: Brisbane, QLD, Australia

Post by Domarius »

...so... does anyone agree/disagree?

I'd like to know Nikolaus's thoughts on this.
Homer
Posts: 58
Joined: Tue Nov 18, 2003 7:11 pm
Location: Germany

Post by Homer »

Domarius wrote:...so... does anyone agree/disagree?

I'd like to know Nikolaus's thoughts on this.
Me too, but it seems that he's very busy at the moment. I'm also waiting for his response to my email regarding this topic.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Wow, 330 MB is a lot, don't know how it gets that big. Did you try to convert it to another file format and check out if the memory usage is still that high? And about a mail: Hm, I think I did not recieve a mail on that topic... At least my Outlook keeps telling this, sorry.
Homer
Posts: 58
Joined: Tue Nov 18, 2003 7:11 pm
Location: Germany

Post by Homer »

Yes, it's nearly the same when I use the x-format: still 300 MB. Regarding the mail: I've sent it on 16th of April to your sourceforge-account. Hm, maybe it got lost somehow, so I'll resend it.
Domarius
Posts: 178
Joined: Thu Mar 11, 2004 9:51 am
Location: Brisbane, QLD, Australia

Post by Domarius »

Cool, Niko is here :)

Niko, are you able to load levels, meshs, etc, and NOT experience such huge RAM usage?

If so, then its possible for us to as well, if not, then I guess it's a bug and we'd have to wait for it to be fixed.
Post Reply