How to completely release GpuMat memory

Hi, on your first call the cuda context is initialized which uses 83MB (95223808 - 8192000 = 87,031,808). This is not released when you release the last piece of device memory you have allocated. It stays initialized so that future calls don’t incure the overhead of allocating the context.