During the long-term stable running of test cases, memory leak occurs. Memory consumption keeps increasing as shown in Figure 1.
The possible cause is as follows:
Typically, memory leaks occur because allocated memory is not freed.
To rectify the fault, perform the following steps:
Check all the memory-related API pairs to ensure the allocated memory is freed when the memory is no longer needed. For example, check the API pairs of aclrtMalloc and aclrtFree, aclrtMallocHost and aclrtFreeHost, and aclrtCreateStream and aclrtDestroyStream.