开发者

Mystery OpenGL/SDL memory growth

This is my first "game" I'm working o开发者_开发百科n in C++ using OpenGL for graphics and SDL for the application. My code appears to work as I am able to create a functional application window and fully load and draw a texture with the Devil Texture library. The problem arises at runtime. My Memory usage, according to Windows Task Manager, starts at around 13,900 but steadily grows to about 15,000 after 4 minutes or so and then stops. Is this normal? Is Windows Task Manager an inaccurate way of viewing memory?


Could be some memory leaks in your code, i.e. non freed pointers..etc...

On Linux, I would use Valgrind to check this at runtime. I'm not sure what the equivalent is for Windows. This post should point you in the right direction for finding an equivalent tool

Cheers


If you're doing dynamic memory allocation and deallocation during the execution of your app, it could be that you're fragmenting memory and just need that much to deal with all of the "slop" around the fragmentation.

I've used the MMGR package from http://www.fluidstudios.com/ before to track my memory usage. Basically it allows you to dump great information on all of the allocations in your program, so you can track frame to frame to see what's going on.

Good luck.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜