Memory Release Failure
Symptom
During the long-term stable running of test cases, memory leak occurs. Memory consumption keeps increasing as shown in Figure 2-1.
Cause Analysis
The possible cause is as follows:
Typically, memory leaks occur because allocated memory is not freed.
Solution
Perform the following steps to rectify the fault:
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.