Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6712 Discussions

Multimple IppInit() and memory leak with _IPP_PARALLEL_STATIC at ippcore_t

Yaroslav_Korchevsky
1,430 Views
I use statically linked IPP in mulithreading application which consists of many modules.
Modules may be loaded and unloaded.
Each IPP linked module require IPP to be initialized.
However, as it is known, IppInit() is required to be called once per process.
Multiple calls to IppInit() produces memory leaks.

Use IppInit() in main module is not allowed by design.
So, each module at load time needs to decide is IppInit() required or not.
I didn't find any way to make my application call IppInit() only once per process.

Does anybody know is there any method to find is IPP initialized already or not?

PS. Environment: VisualStudio C++ 2008
0 Kudos
1 Solution
Sergey_K_Intel
Employee
1,429 Views
Yaroslav,
I see _kmp_str_format call wher you have pointed at. It allocates about 3K bytes for setting environment variable. But, after FreeLibrary the allocated memory gets back to operating system.
The problem is not in that kmp_str_format allocates something. The question is why this memory is not returned back after FreeLibrary call?
Could you ask this on Intel compiler forum?
By the way, you can prepare the test sample without IPP, only with OpenMP. Create a empty DLL linked to libiomp5 (i.e. Intel's OpenMP). Call omp_get_num_procs, then unload your custom DLL. Will the behavour be the same?
Regards,
Sergey

View solution in original post

0 Kudos
26 Replies
Yaroslav_Korchevsky
194 Views
Sergey.
Is there any progress?
0 Kudos
Yaroslav_Korchevsky
194 Views
To whom this issue may be addressed if not you?
0 Kudos
SergeyKostrov
Valued Contributor II
194 Views
Hi Yaroslav,

Quoting Yaroslav Korchevsky
Sergey.
Is there any progress?


I'm sorry - No. However, I'll take a look at the recent thread posts.

Best regards,
Sergey

0 Kudos
Chao_Y_Intel
Moderator
194 Views

Hello Yaroslav,

I see Sergey provided some suggestion on the replay on #20:

This problem looks related to the OpenMP libraries. The OpenMP library comes from Intel Compiler, and Intel IPP use this library for function threading. That is why he suggested checking this problem on the Intel compiler forum:

To show this problem clearly, he also suggest following the following test case:

You can prepare the test sample without IPP, only with OpenMP. Create a empty DLL linked to libiomp5 (i.e. Intel's OpenMP). Call omp_get_num_procs, then unload your custom DLL. Will the behavour be the same

That will help to isolated if the root problem come from OpenMP.

Thanks,
Chao

0 Kudos
Yaroslav_Korchevsky
194 Views
Thank you, Chao,

I prepared purified example with OpenMP only.
My question was about where to post it.


0 Kudos
Chao_Y_Intel
Moderator
194 Views

Hello Yaroslav,

Here is the forum for the compiler:
http://software.intel.com/en-us/forums/intel-c-compiler/

Thanks,
Chao

0 Kudos
Reply