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

Memory leak and handle leak for IPP

Lamp
Beginner
472 Views
Hi,

we are using Windows XP sp2 & IPP 6.1.3

we noticed there are some memeory leak and handle leak in our application,

after check with DebugDiag, we found both memory leak and handle leak are caused by IPP.


Memory Leak:
we are using Decompress1 method from IPP samples, DebugDiag's report shows we will losse "2.57 KBytes" memory for each call.

here is the call stack:

ippcore_6_1!ippGetLibVersion+b43

.DecodeHuffman(Byte*, Int32, Byte*, Int32*, HuffState_8u*) 0x7260434

.Decompress1(Byte**, Int32, Byte**, Int32*, _bwt_state*)

Handle Leak:

the call stack is:

libiomp5md!_kmp_reap_worker+a6b kernel32!CreateEventA

0x79FCB7E7

libiomp5md!_kmp_invoke_microtask+65

libiomp5md!_kmpc_invoke_task_func+6a libiomp5md!_kmp_invoke_microtask

libiomp5md!_kmp_fork_call+290

libiomp5md!_kmpc_fork_call+2b


Please check ifit's reproduceable and suggest the solutions.

Regards,

0 Kudos
9 Replies
PaulF_IntelCorp
Employee
472 Views
Thank you for the feedback, we'll inform engineering.
0 Kudos
Lamp
Beginner
472 Views
Any updates?

Memory leak is killing me.
0 Kudos
Vladimir_Dudnik
Employee
472 Views

Could you please check your case with the latest version of IPP and samples? The latest version is IPP 7.0.3

Vladimir

0 Kudos
Lamp
Beginner
472 Views
not the latest, we are using 6.1.3

do you mean we should upgrade to latest version?
0 Kudos
Vladimir_Dudnik
Employee
472 Views

Looking at Release Notes forfew latest updates I see there are some bug fixes in data compression sample and IPP functions. That is why I think it might be useful for you to check your case with the latest IPP library and sample code (you can register and download evaluation copy to try).

Vladimir

0 Kudos
Lamp
Beginner
472 Views
Hi,

we upgraded to 7.0.3 but have the same problem,
please tell ifippGetLibVersion really caused the memory leak.


Function details

Function ippcore_7_0!ippGetLibVersion+bbf

Allocation type Heap allocation(s)

Heap handle 0x04ea0000

Allocation Count 25873 allocation(s)

Allocation Size 64.94 MBytes

Leak Probability 95%

Top 1 allocation sizes by allocation count

2.57 KBytes

25,873 allocation(s)

Top 1 allocation sizes by total size

2.57 KBytes

64.94 MBytes


Call stack sample 1

Address 0x3413bc38

Allocation Time 01:20:05 since tracking started

Allocation Size 2.57 KBytes

Function Source Destination

ippcore_7_0!ippGetLibVersion+bbf

0 Kudos
Vladimir_Dudnik
Employee
472 Views
Hello,

ippGetLibVersion does not allocate any memory inside. It return pointer to statically allocated library version structure (that's why you are not required to call free() function to this pointer). I'd think this cause false positives at run-time checking tools,I remember similar false positive report caused by Valgrind tool under Linux discussed on this forum some time ago.

Regards,
Vladimir
0 Kudos
Lamp
Beginner
472 Views
Hi,

I have to trace it with WinDbg, and it also shows the leak coms from ippGetLibVersion, please help to figure it out what's the problem:

1. with "!heap -s" command, I found the memory usage of "05ea0000" is increased after run our app for half an hour.

Heap Flags Reserv Commit Virt Free List UCR Virt Lock Fast

-----------------------------------------------------------------------------

05ea0000 58001062 31808 17952 17952 986 367 1 0 7288 L

2. with "!heap -stat -h 05ea0000" we can see most of them has a size of a48, which is 2.75K that reported by DebugDiag.

heap @ 05ea0000

group-by: TOTSIZE max-display: 20

size #blocks total ( %) (percent of total busy bytes)

a48 1983 - 1064ad8 (99.90)

3. I search a48 with "!heap -flt s a48", all of them are located in 05ea0000 and there is a huge list:

_HEAP @ 5ea0000

HEAP_ENTRY Size Prev Flags UserPtr UserSize - state

05ea4f50 014c 0000 [07] 05ea4f58 00a48 - (busy)
......
18429030 014c 014c [07] 18429038 00a48 - (busy)

4. with "!heap -p -a 18429030" I get:

address 18429030 found in

_HEAP @ 5ea0000

HEAP_ENTRY Size Prev Flags UserPtr UserSize - state

18429030 014c 0000 [07] 18429038 00a48 - (busy)

Trace: 25a8

7c96fbca ntdll!RtlDebugAllocateHeap+0x000000e1

7c94b244 ntdll!RtlAllocateHeapSlowly+0x00000044

7c919c0c ntdll!RtlAllocateHeap+0x00000e64

5ca4f8f ippcore_7_0!ippGetLibVersion+0x00000bbf


I don't know if we did something wrong in our application, please help to solve it.

0 Kudos
Vladimir_Dudnik
Employee
472 Views
Do not be messed with fasle positive alarm which some tools may detect for ippGetLibVersion. As I said before this function do not allocate any memory.

If you see memory leak which comes from running application for a long time it is not caused by ippGetLibVersion. The reason is something else.

Vladimir
0 Kudos
Reply