PDA

View Full Version : Memory issues Imagedata & textures.



klapsd
04-23-2011, 09:59 AM
Hi,

I'm having some difficulties with a webapp that I'm writing at the moment. Basically what I'm doing is working with a large array of images, and then creating textures of these images to draw in a 3D scene.

This all works very well, but I'm facing some memory issues. (as in: the memory usage is enormous :? ) What I'm trying to do is delete (nullify) the image arrays, and continue to work with the textures after all is done. This works, I don't have any access to my image arrays left, but I can still use the textures. The problem is that the memory usage isn't any lower.

My question: is it possible to delete the image array and keep the textures and free the memory of the images. Or is there still a reference from the textures to the image src and does this prevent it from freeing memory?.

My Second question if the deletion is not possible: Is copyTexImage2D a useful option to consider? I presume that if I create a copy of the texture through the framebuffer, it won't have any references left to the image array and the garbage collector will free up the memory?

Thanks!

klapsd
04-24-2011, 03:45 AM
Ok I found the solution. Seems like it was already answered in the forums.
viewtopic.php?f=43&t=3367 (http://www.khronos.org/message_boards/viewtopic.php?f=43&t=3367)
Sorry for the useless topic.