Problems with CudaFreeHost

Hi everyone,
i’m writing because i’ve a problem using the function cudaFreeHost in order to free pinned memory previously allocated with the function

cudaHostAlloc((void **)&h_idata, mem_size, cudaHostAllocWriteCombined)

The problem is that, using the taskManager, i noticed that the cudaFreeHost return cudaSuccess but the memory remains busy.

How can i solve this issue??

Thansk in advance.


perhaps try cudaHostMalloc, and see if the matter persists

(then) see if the issue does not relate to your particular flag selected

I See that the problem is related to the flag cudaHostAllocWriteCombined.
If i try the same function with the flag cudaHostAllocDefault, it returns cuda_success error.
Vice versa using the flag cudaHostAllocWriteCombined, also with function cudaMallocHost, it returns error(2) message.
The function returns me address 0x000000007fff0000.

are you sure you do not accumulate errors beforehand, regardless of the kind?

perhaps use a memory checker, like memcheck or valgrind, to see whether your memory management is not derailing on a preceding memory allocation already