After a lot of struggle I found that in my case I was not swapping the drawing and rendering buffers at the end of rendering loop leading to GL_OUT_OF_MEMORY
. So I think what might be happening is that renderer was continuously drawing to FrameBuffer which might be requesting memory every time we draw to it. Since, I was not swapping it so memory was not deleted and instead more memory was continuously accumulated...leading to GL_OUT_OF_MEMORY