Skip to main content
GameDev.net gamedev.net
🔒 Locked

nvidia memory leak (solved)

Started by vibe3d Sep 26, 2007 at 6:26 AM 13 replies 6.9k views
Original Post
vibe3d
vibe3d
Hi Guys I think i have found a bug in the nvidia windows drivers. My Hardware Nvidia 8800gts 640mb ForceWare 162.18 Windows XP sp2 Visual Studio 2005 sp1 What i have noticed is a very small memory leak that appears to just keep on growing, the memory leak will stop if you never make a call to SwapBuffers. I have been able to reproduce this bug using both SDL and just regular windows API. What i describe above will happen with the opengl initialize demo from codesampler.com if you want to check it out. I have tried with forceware 163.44 too and the same thing happens. Can anyone else in here confirm this on there machine? [Edited by - vibe3d on September 27, 2007 7:14:27 AM]
ViperG
ViperG
are you saying all opengl programs that use swapbuffers have a memory leak?

well I just downloaded it and ran the exe and my memory usage is 5,444k and it's staying at that.

So no memory leak for me
Black Sky A Star Control 2/Elite like game
vibe3d
vibe3d
well the two i have tried do.

i actually noticed it just before while checking memory usage in my own 3d engine, at first i assumed it was a mem leak in my engine but i couldn't find it anywhere so i tried a really simple GL hello world type SDL app it leaked with that so i downloaded that demo from codesampler and it does it too. If you comment out the call to SwapBuffers (SDL_GL_SwapBuffers in sdl app) it does not leak memory
vibe3d
vibe3d
what gpu do you have ViperG?
ViperG
ViperG
just run the provided exe and see if it has a memory leak.

if you only get a leak when you compile then that is your problem.

nvidia 6200
Black Sky A Star Control 2/Elite like game
vibe3d
vibe3d
Quote:
Original post by ViperG
just run the provided exe and see if it has a memory leak.

if you only get a leak when you compile then that is your problem.

nvidia 6200


yes the downloaded exe leaks, believe me i ain't stupid i would not have posted if i hadn't tried everything first ;-)
ViperG
ViperG
well dunno what to tell you, im not seeing any leaks in the opengl downloads off code sampler.
Black Sky A Star Control 2/Elite like game
sebarnolds
sebarnolds
Hi.

That sounds like something similar to one of my (quite old) problem I had with my NVidia Quadro and OpenGL (see here). It doesn't seem to be exactly the same.

In my case, I didn't use the z-buffer and all the screen was overwritten each frame so I had no use to call glClear. Then, when I began doing 3D, a leak appeared and I needed to call glClear (even glClear(0)) to get rid of it.

Hope it helps,
Sebastien
Lead programmer of the (slowly evolving) syBR game engine --- http://sybr.sourceforge.net
vibe3d
vibe3d
the code does call glClear each frame
vibe3d
vibe3d
Quote:
Original post by ViperG
well dunno what to tell you, im not seeing any leaks in the opengl downloads off code sampler.


cheers for checking anyway, perhaps this is a bug with the 8800??
vibe3d
vibe3d
has anyone got a contact at nvidia i can send this too? ..i am now 100% sure this is a NVidia driver issue with the 8800
vibe3d
vibe3d
ok i have finally noticed that the memory leak actually stops.

Basically here is the final picture

If your scene is rendering any geometry the memory usage will leak for a few minutes than level off and stay put. If you are scene has no geometry it will leak even slower but will eventually level off and stay put. Kinda weird but it does stop and only appears to leak a few MB so i guess it ain't worth chasing up. I know this does not happen on most of the other NVidia hardware i have tested it on. So if anyone does have an 8 series geforce perhaps take a look and see if you get the same thing happen too.
Neutrinohunter
Neutrinohunter
Are you sure, the Card isn't just using extra memory then deleting it later?
V-man
V-man
If it levels off, then there is nothing to worry about. It's just the driver allocating RAM for it's own needs.
vibe3d
vibe3d
well when i say it levels off the ram never drops (as in a driver allocating ram than freeing it) it just slowly goes up to a certain amount than stays there, i just found it weird that every other NVidia card i have tried this on it does not show this behavior.

It doesn't really matter, it is not a leak as i had thought. I am just more curious why it does it and why no other model nvidia card does (not that i know of anyway) it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.