Jump to content
  • Advertisement
Sign in to follow this  
Serenity54

OpenGL Memory leak

This topic is 3811 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm having trouble with some code (taken directly from the tutorial here: ZeusCMD). I've also used the code from NeHe, it does the same thing. What's happening is I get about a 4 KB increase per second. And before you get all "do a search first noob!" on me... I don't have an ATI card, I have an Nvidia GeForce Go 7950 GTX with the newest (Dell) video drivers (in a Dell XPS laptop). Is my problem the same as those with ATI cards? Or is there actually a leak in the code? Thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
Honestly with out knowing more it is only a guess at best.
Have you added to the projects they are showing. I didn't see much in the project you pointed to that would cause such an issue. I am fairly familiar with nehe they seem to have no problems I can point at, or more precise I haven't experienced any doesn't mean others won't though.

Look for where you are allocating memory and see if it is getting called multiple times and if it is releasing the old one first.

Like I said though the best I can do is guess.

Share this post


Link to post
Share on other sites
The code I'm using has been downloaded from the site directly and compiled as is. Same with the NeHe tutorial code. I also ran the pre-compiled exe in the NeHe tutorial (lesson01) and it did the same thing.

This is why I'm confused.. when I searched for the problem I saw a bunch of posts about it but all of them said ATI drivers, and nothing about Nvidia.

I hope someone will be able to clarify this. :S

Share this post


Link to post
Share on other sites
Are you using Visual C++ compiler?
It will help you find memory leaks.

Run your app through debugger, and exit. The output window will give you a list of memory leaks, and a index number.

Hit F11 to start debugging again, and this time add "_crtBreakAlloc" to the watch window, and give it the index number from the first pass. Then hit F5 to run the app. The debugger will halt on the allocation of the source of the memory leak.

A memory leak happens from the following code :

pChar = Malloc(100);
pChar = Malloc(100);//100 bytes lost because you overwrite the pointer. (no pointer means you cant release the first memory allocated).

Share this post


Link to post
Share on other sites
This discussion has come up before and it was about nVidia the last 2 times. The driver allocate space during runtime and at some point, it stops. It might even release memory for a while, then start allocating again.
He was just calling glClear and SwapBuffers. This is nothing to worry about.

Share this post


Link to post
Share on other sites
>>So in other words it's the same as the ATI posts and there's nothing I can do about it?

Well you dont have a debugger, so yes, methinks there's nothing you can do about it.

Get Visual C++... ie a real compiler.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hello Kitty
>>So in other words it's the same as the ATI posts and there's nothing I can do about it?

Well you dont have a debugger, so yes, methinks there's nothing you can do about it.

Get Visual C++... ie a real compiler.

Been there, done that.. I'd rather not go back down that road again...

Anyway, thanks for the help.. I guess I'll just have to try to ignore the leak. :(

Share this post


Link to post
Share on other sites
Quote:
Original post by Hello Kitty
>>So in other words it's the same as the ATI posts and there's nothing I can do about it?

Well you dont have a debugger, so yes, methinks there's nothing you can do about it.

Get Visual C++... ie a real compiler.


MinGW is a "real" compiler.

And GDB works just fine with Code::Blocks.

This wiki page should be enough to start with debugging, although it's far from comprehensive. This pdf manual for Code::Blocks has rather better info on debugging some way down (after all the installing and setting up projects stuff).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!