Browse Source

data_request: Fix memory leak on prefetch getting ENOMEM

Samuel Thibault 4 years ago
parent
commit
b54df49e0a
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/datawizard/data_request.c

+ 5 - 0
src/datawizard/data_request.c

@@ -556,6 +556,11 @@ static int starpu_handle_data_request(struct _starpu_data_request *r, unsigned m
 	{
 		/* If there was not enough memory, we will try to redo the
 		 * request later. */
+
+		if (r->prefetch > STARPU_FETCH)
+			/* Drop ref until next try */
+			dst_replicate->refcnt--;
+
 		_starpu_spin_unlock(&handle->header_lock);
 		return -ENOMEM;
 	}