Game Development Community

Need to dump mem and cpu usage.

by Radoslaw Marcin Kurczewski · in Torque Game Engine · 10/03/2002 (3:43 am) · 4 replies

Hi. Sprite emitters is taking cpu and mem after rendering. Dont know why??

I thought first it was the render engine that doesnt dump texture data. Applied only one texture on entire level. Still the same problem. High framerate from start, but it gets slower after every room i visit. After one lap i have modest 8-9fps. Deleted all models and sprite emitters. Now it works perfect. And after putting in all models with the same succes on fps, i knew it was the sprite emitters. They are locking mem, and take cpu even if they are not rendered. They start after first visual contact, then it never dumps data and free my mem or cpu.

Hope you understand what iam trying to explain.:)
Cheers

#1
10/05/2002 (5:35 am)
Maybe my question was a bit diffuse. Have anyone made code for dumping data and memory after particles has been rendered. Or if someone could give example how to solve this issue.

Hope someone can help me out.....
Thanks.
#2
10/05/2002 (11:04 am)
Go use the debugging features in your development tools :)

You might also want to check out the profiler - see platform/profiler.h for that, and check the forums if you have difficulty using it.

You should also be able to dump the amount of memory Torque is using. (At the very least, you can use the task manager, if you're on 2k or XP, or a 3rd party tool if you're on an older system).
#3
10/06/2002 (3:34 am)
Thanks for the replay, but you didnt understand my question. I wanted to free mem and cpu in-game ofcourse.

If i have two rooms (Particle emitters in the first).
Particles in the first room gets rendered. Walks into next room. The particle emitter is not rendered anymore, but still locks cpu and memory. As soon as rendering of the particle stops, the engine should free cpu usage and mem. If someone have example code. Please let me know. Or can help in any way.....
I think this is serious and someone most have noticed it before....
Cheers....
#4
10/06/2002 (6:09 pm)
To fix this problem, you need to identify the specific chunks of memory that aren't being freed, and modify the engine to free this memory at the right time.

It might be that there is a memory leak in the engine (bad, but potentially easier to fix), or just that the engine doesn't do any visibility checks on particles.

Unless someone has a premade fix, you _will_ have to become familiar with your debugger and find out where the memory is going.

This might be fixed in HEAD...