For some reason, I ported CudaSift to Visual Studio 2019(Cuda 11.6) for testing and found that some codes in cudaSiftH.cu may cause memory leaks. Here are the codes, line 134 to 135, in function ExtractSift.
if (!tempMemory)
safeCall(cudaFree(memoryTmp));
There seems to be something wrong with the judgement logic here. According to these codes, if tempMemory is NULL then it should be freed. But actually, before we call the function ExtractSift, tempMemory has been allocated memory in GPU. So when the function ends, the memory for tempMemory will not be freed, and it will cause memory leaks.
For some reason, I ported CudaSift to Visual Studio 2019(Cuda 11.6) for testing and found that some codes in cudaSiftH.cu may cause memory leaks. Here are the codes, line 134 to 135, in function ExtractSift.
There seems to be something wrong with the judgement logic here. According to these codes, if tempMemory is NULL then it should be freed. But actually, before we call the function ExtractSift, tempMemory has been allocated memory in GPU. So when the function ends, the memory for tempMemory will not be freed, and it will cause memory leaks.
Revised version here.