Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6980 Discussions

Delete data fitting task seems to fail clearing internal memory

Mario_K_
Beginner
631 Views

Hi,

I have observed that deleting an interpolation task by dfDeleteTask doesn't affect the number of allocated buffers (using mkl_mem_stat). Is this an expected behaviour? According to the manual of dfDeleteTask I expect the deallocation owned by the task.

To explain this I have attached code which is an adapted example taken from https://software.intel.com/en-us/node/522217. I have executed the attached example with icpc version 17.0.0.

Thank you very much for helpful comments.

 

0 Kudos
1 Solution
Vladislav_V_Intel
631 Views

Hi Mario,
Data Fitting component of Intel MKL internally relies on use of the Intel MKL memory allocator.
To improve the performance of the Intel MKL based application, the allocator uses memory pools where buffers can be collected for fast re-use.
You should call  mkl_free_buffers() routine, that frees unused memory allocated  by the memory allocator, after the last call to the library’s functions.
Please, see additional details on mkl_free_buffers() routine at https://software.intel.com/en-us/node/522136
You may want to check the status of Intel MKL memory allocator by calling the mkl_mem_stat() routine before and after call the call to mkl_free_buffers() routine.

Best regards,
Vlad V.

 

View solution in original post

0 Kudos
2 Replies
Vladislav_V_Intel
632 Views

Hi Mario,
Data Fitting component of Intel MKL internally relies on use of the Intel MKL memory allocator.
To improve the performance of the Intel MKL based application, the allocator uses memory pools where buffers can be collected for fast re-use.
You should call  mkl_free_buffers() routine, that frees unused memory allocated  by the memory allocator, after the last call to the library’s functions.
Please, see additional details on mkl_free_buffers() routine at https://software.intel.com/en-us/node/522136
You may want to check the status of Intel MKL memory allocator by calling the mkl_mem_stat() routine before and after call the call to mkl_free_buffers() routine.

Best regards,
Vlad V.

 

0 Kudos
Mario_K_
Beginner
631 Views

Hi Vlad,

thanks for this useful hint!

I hoped to use mkl_mem_stat to detect memory leaks in my code. This implies that the information provided by mkl_mem_stat is useless this case.

Best regards,
Mario

0 Kudos
Reply