I have an issue when I run a little test about “cudaMalloc” and “cudaFree” on TX2.
Each time I apply for memory on GPU, and it returns “success”. Then, I “cudaFree” it, and its value is “success” also. But, when I use “tegrastats” to see the GPU usage, I found that the usage didn’t reduce. To be more straightforward, suppose I apply for 1GB memory by “cudaMalloc”, and the RAM usage is 1GB; then after my “cudaFree” success, the RAM usage is still 1GB, which is unreasonable I think.
Even worse, if I repeat these two steps: cudaMalloc and then cudaFree memory(1GB), for 7 times. then ,the program is KILLED.
By the way, when I apply for memory on CPU by “malloc” and “free”, it’s all correct.
So, my question is why I can’t cudaFree the memory on GPU really ?