Free GPU Memory after deleting texture

Started by
12 comments, last by AhmedAli 12 years, 9 months ago
[size="4"]hi every body,
I'm using FBO in my application.. at some points My app rendering resize and i need to delete and recreate the FBO by the new dims and data .. it works fine but i noticed that the glDeleteTextures doesn't free the GPU memory that resulted in accumulated GPU memory leakage at run-time. this is my code to delete the FBO and its texture


glDeleteFramebuffersEXT( 1, TempFrameBuffer);
glDeleteTextures( 1, Tempimage);


can you find what i missed? are there any method to free the GPU memory after deleting texture?
thanks in advance for your help :)
Advertisement
i noticed that the glDeleteTextures doesn't free the GPU memory that resulted in accumulated GPU memory leakage at run-time
What method did you use to determine this?
[size="4"]i used GPUShark app (downloaded from www.geeks3d.com )to monitor the GPU resources at run-time .. it's really helpful but the graphics card driver should be updated to give accurate results
Do you expect the memory will be deallocated at the same moment you call glDeleteTextures()? It is a wrong assumption.

Drivers allocate/deallocate memory at the most suitable moment. Try extensively to allocate/deallocate textures to see whether you will run out of memory.

Do you expect the memory will be deallocated at the same moment you call glDeleteTextures()? It is a wrong assumption.

Drivers allocate/deallocate memory at the most suitable moment. Try extensively to allocate/deallocate textures to see whether you will run out of memory.


[size="4"]The GPU memory usage is increasing by a fixed value for every recreated texture and it is increasing continuously without decay .. by this rate it just about time to run out of memory but this-based on my calculations- will happen
As Aks9 already explained
http://www.opengl.org/wiki/FAQ#Memory_Usage
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
[size="4"] OK , but do you find it reasonable that there is noway to free the the allocated GPU memory which is possible and a very simple operation in the system RAM !!!

[size="4"] OK , but do you find it reasonable that there is noway to free the the allocated GPU memory which is possible and a very simple operation in the system RAM !!!
...but the driver might be planning on re-using that allocated memory. If it's holding onto an allocation, so that it can re-use it at some point, or if it "frees" the allocation (so that it can be re-used at some point), what's the difference?
[size="4"]Yesterday i tested my application it continued for about 2 hours and the GPU memory usage increased until it reached about 75% without decay .. Although i'm deleting the old textures every about 10seconds. Do you think that the system didn't reached that point at which the memory should be reused? Is that safe ?
Use gDebugger and see if he reports a memory leak. It is a very good and free OpenGL Debugger.

http://www.gremedy.com/
If you say "pls", because it is shorter than "please", I will say "no", because it is shorter than "yes"
http://nightlight2d.de/

This topic is closed to new replies.

Advertisement