Community
cancel
Showing results for 
Search instead for 
Did you mean: 
danielwang1971
Beginner
53 Views

CJPEGEncoder Memory Leak problem if compiler with OpenMP in VS2005

Hello,

I met a problem toexportjpegfile by CJPEGEndoer.

Every thing is fine if OpenMP disabled in MS VS 2005 with IPPV5.3. However,I gotmemory leakwhen enable OpenMP.

I think the problem is that omp_lock_t don't free.It should call omp_destroy_lock(...) to free it in VS 2005 after omp_init_lock(...). (I don't know about itfor Intel Compiler).

For Example in thefile jpegenc.cpp:

......

#ifdef _OPENMP

omp_lock_t* locks;

#endif

....

#ifdef

_OPENMP

locks = (omp_lock_t*)ippMalloc(

sizeof(omp_lock_t) * m_numyMCU);

for(i = 0; i < m_numyMCU; i++)

{

omp_init_lock(&locks);

}

#endif

.......................

#ifdef

_OPENMP

//To free locks in VS 2005

for(i = 0; i < m_numyMCU; i++)

{

omp_destroy_lock(&locks);

}

ippFree(locks);

#endif

Best regrads,

Daniel

0 Kudos
1 Reply
Vladimir_Dudnik
Employee
53 Views

Hi Daniel,

Your observation is correct, we have also found that mistake (unfortunately after IPP 6.0 beta update release). It will be fixed in the next IPP update release and of course in the next new version (6.0). Thanks for your interest to IPP product and IPP based JPEG codec and for submitting issue report.

I'll create problem report on Intel Premier Support for you, so you will be notified when update will be available.

Regards,
Vladimir

Reply