cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

AntiLeaker
Journeyman III

Memory leaks with OpenGL function glCompileShader when using Catalyst 10.x / 11.x 32-bit/64-bit

Memory usage grows up at each call of glCompileShader with Catalyst 10.x / 11.x.

(sorry for my technical english)

There is no such problem on nVidia cards or with older Catalyst version 9.x. (eg 9.3, 9.10). This memory leak is a feature of latest Catalyst drivers 10.x /11.x both 32 and 64 bit version.

I can test this leak only with my Radeon HD 4850, but probably there are same memory leaks occurs with other HD series videocards when used Catalyst drivers 10.x / 11.x 32-bit/64-bit for Windows XP/Windows 7 32-bit/64-bit.

First example:

while (1)

{

glCompileShader(ShaderObject);

}


According OpenGL specification this endless loop should not cause memory leaks or handle leaks. Memory usage should not grows up and handles count in system should not steadily increase.

This is true when using Catalyst 9.x. But with latest Catalyst drivers, (for example, with Catalyst 11.8) there occur memory leak and handle leak.

If Catalyst 10.x or 11.x is used then after 10000 iteration of glCompileShader our process have additional 10000 unclosed handles in system (1 unclosed handle per iteration) and almost 50 MB unfreed memory (about 5000 bytes leak per iteration).


Second example:

while (1)

{

glCompileShader(ShaderObject);

glGetShaderiv(ShaderObject, GL_COMPILE_STATUS, &CompileStatus);

}


There is no difference between first and second examples on nVidia cards or when using Catalyst 9.x because in older catalyst drivers there are no memory and handle leaks in glCompileShader.

But leaked Catalyst 10.x / 11.x drivers do some cleanup only when function glGetShaderiv or glGetShaderInfoLog is called after each glCompileShader. So, in second example there is no handle leak and memory leak... except about ~50 bytes leak per iteration (50 bytes is not so much as 5000 but older catalyst 9.x have 0 bytes leak even with endless loop of glCompileShader).



Third example:

while (1)

{

// Create window, OpenGL context and only 1 very simple shader

...


glCompileShader(ShaderObject);

glGetShaderiv(ShaderObject, GL_COMPILE_STATUS, &CompileStatus);

// Delete shader, OpenGL context and window

...

}





Wow! In this case with latest catalyst drivers we have huge memory leak. About 2400-2600 KB per iteration!

Comment line glCompileShader(ShaderObject); and memory usage does not grows up. Uncomment glCompileShader(ShaderObject); and we loose 2,5 MB per iteration!





There is no such problem on nVidia cards.

There is no such problem with older Catalyst 9.x

This memory leak is a feature of latest Catalyst drivers 10.x /11.x both 32 and 64 bit version.





Attachment and link

20 KB zip-archive with C source code and Win32/64 bit binaries for tests:


http://www.sendspace.com/file/me7216

0 Likes
3 Replies
gsellers
Staff

Hi,

We've recently found and fixed several memory leaks in the shader compiler. It's quite possible that the leak you've found has already been fixed. Regardless, thanks for reporting this. We'll use your sample to see if we can find any more.

Thanks

0 Likes

Hi,

I've experienced the same problem on a ATI FirePro V4800 (ver. 8.85.7.2, Win7x64) graphics adapter. Unfortunately there is no newer driver, yet. Can you confirm, that the memory leak, mentioned by AntiLeaker, is still not resolved?

Thanks

0 Likes

We are experiencing these leaks too. I'm using a graphics card identified in Windows as "ATI Radeon HD 4300/4500 Series". I'm testing a 32-bit application on Windows 7 64-bit with the latest 11.12 Catalyst drivers.

0 Likes