We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1568

Summary: glXSwapBuffers
Product: SDL Reporter: zhuweitao <p15018405735>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: HG 2.0Keywords: target-2.0.0
Hardware: x86_64   
OS: Linux   

Description zhuweitao 2012-08-13 02:40:16 UTC
it seems glXSwapBuffers momery leak when call SDL_GL_SwapWindow,
the program is about 122M when it start ,but serval minutes later,it turn out to be 150M
Comment 1 Ryan C. Gordon 2013-07-12 22:15:58 UTC
(Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.)

Tagging a bunch of bugs as target-2.0.0, Priority 2.

This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible.

That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship.

Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment.

Thanks!
--ryan.
Comment 2 Ryan C. Gordon 2013-07-20 20:28:08 UTC
Taking this bug.

--ryan.
Comment 3 Ryan C. Gordon 2013-07-20 20:40:15 UTC
Either we fixed this, or it's an application or driver bug.

Here's the "testgl2.c" program in SDL's "test" directory, as reported by "top":

32646 icculus   20   0  101m  32m  21m R  100  0.0   0:13.93 testgl2

This program just creates a window, draws a spinning cube in it, and calls SDL_GL_SwapWindow() as fast as possible...over 9500 times a second on my workstation.

After several minutes, memory usage hasn't changed, according to "top":

32646 icculus   20   0  101m  32m  21m R  100  0.0   4:35.87 testgl2                                                                                                                                                                           

So it doesn't appear to be leaking.

Further, Valgrind doesn't report any relevant leaks.

So if SDL has a leak at all at this point, it's not in SDL_GL_SwapWindow().

Closing this bug as FIXED. If you have a small test case that still demonstrates the problem, please reopen the bug and we'll look at it further.

Thanks!

--ryan.