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

MKL 8.0 memory problem in Visual Studio 2005

wl2006
Beginner
291 Views

Hi,

I am using MKL 8.0 in a native C++ project in Visual Studio 2005. When I checked for memory leak, I noticed that part of the memory used by MKL didn't get deallocated. The memory was allocated when I call the first MKL function, which is cblas_dgemm. My program was statically linked to mkl_c.lib and libguide.lib.The memory leaks are repeatable and steady. It doesnt grow with time. I attached some detail info at the end of this mail. Any insights will be greatly appreciated. Thanks!

WL

______________________________________________________

1. LNK warnings, do they matter?:

1>libguide.lib(kmp_ftn_extra.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_csupport.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_sched.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_global.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_runtime.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(z_Windows_NT-586_util.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_alloc.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_lock.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_debug.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_error.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_statgen.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_ssp.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_i8_sched.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_i8_dispatch.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_threadprivate.obj) : warning LNK4224: /COMMENT is no longer supported;
ignored
1>libguide.lib(kmp_dispatch.obj) : warning LNK4224: /COMMENT is no longer supported; ignored
1>libguide.lib(kmp_utility.obj) : warning LNK4224: /COMMENT is no longer supported; ignored

2. Memory leaks:

Information deleted ...

0 Kudos
1 Reply
wl2006
Beginner
292 Views

Found Intel's official explaination for the problem:

Intel MKL Does Not Immediately Release Memory

In order to achieve better performance, memory allocated by Intel MKL is not released. This behavior is by design and is a one-time occurrence for Intel MKL routines that require workspace memory buffers. Even so, the user should be aware that some tools might report this as a memory leak. Should the user wish, memory can be released by the user program through use of a function made available in Intel MKL or memory can be released after each call by setting an environment variable (see technical user notes in the doc directory for more details).

Using one of these methods to release memory will not necessarily stop programs from reporting memory leaks, and in fact may increase the number of such reports should you make multiple calls to the library thereby requiring new allocations with each call. Memory not released by one of the methods described will be released by the system when the program ends.

____________

By the way, MKL_FreeBuffers() doesn't seem to be working. It referenced an external symbol that is unresolvable.

WL2006

0 Kudos
Reply