geqrf_bufferSize, by itself, does not allocate (or free) anything.
according to the cusolver documentation for geqrf:
“The user has to provide working space which is pointed by input parameter Workspace. The input parameter Lwork is size of the working space, and it is returned by geqrf_bufferSize().”
The usual method to do that would be to call geqrf_bufferSize, and then take the returned value provided in Lwork, and use that as the size parameter in a call to cudaMalloc. The allocated pointer from cudaMalloc is then passed to the actual geqrf function.
If you are doing that repetetively in a loop, without a corresponding cudaFree function, then that would be a problem. It’s impossible to say without seeing your code. If you are not doing it in the loop, its unclear why you would need to call geqrf_bufferSize in the loop (what purpose would it serve to call it but not act on its returned information?) And if you are doing this before the loop, the only way that could be sensible is if your A matrix didn’t change during the loop processing. But if that were the case, why would you need to do Q/R factorization on it repetetively in the loop?
I would suggest the information you’ve provided so far is incomplete and confusing.