NI Home > Community > NI Discussion Forums

LabWindows/CVI

Reply
Member
Sadalsud17
Posts: 2
0 Kudos

Memory leak using imaqDispose

Hi !

 

Thanks to everyone who spend some time  on my problem

 

I don't understand why, but the imaqDispose function create memory leaks.

For exemple,  when I try :

 

    StraightEdgeReport2* straightEdgeReport = NULL;

    .....  

     while( i<6000 )
     {
             straightEdgeReport = imaqStraightEdge(image, roi, IMAQ_SEARCH_DIRECTION_LEFT_TO_RIGHT, edgeOptions, straightEdgeOptions);    
             imaqDispose(straightEdgeReport);   

             i++;

     }    

     ......

 

After a while, I've got an error message that said I haven't enough memory to create a straigthEdgeReport. I tried to use the free() fonction, but I got the same error.

I work with LabWindows 8.5.0.

 

Thanks, A+.

 

Active Participant
YannC
Posts: 591
0 Kudos

Re : Memory leak using imaqDispose

Hi Sadalsud17,

This was reported to R&D (#128911) for further investigation.  Thanks for the feedback!

Best regards

Yann C.

France

Member
Sadalsud17
Posts: 2
0 Kudos

Re : Memory leak using imaqDispose

Thanks...

 

I reopened this topic because of some changes.

Untill the bug is fixed, I simply avoid to use imaqStraightEdges in loops. I have some memory leak (4Ko each time) but it still working.

 

However I recently installed the update Vision 8.6.4 (I did it because I had memory leaks with imaqLearnPattern3).

Now, each time I call imaqStraightEdges I have almost 100 Mo of memory leak, so my programm crash eventually.

 

I need both imaqStraightEdges and imaqLearnPattern in my project...Does anyone know how I can fix this problem or when R&D will release a version without memory leak ?

 

Thanks again for any help,

Best Regards.

Member
myak6647
Posts: 14
0 Kudos

回复: Memory leak using imaqDispose

Dear ALL:

      I also meet this question when using imaqStraightEdge,

 

 StraightEdgeReport2* edgereport=NULL;

 edgereport=imaqStraightEdge(searchImage,roi1,IMAQ_SEARCH_DIRECTION_RIGHT_TO_LEFT,&edgeOptions,&straightEdgeOptions);
 startX=edgereport->straightEdges->straightEdgeCoordinates.start.x;
 startY=edgereport->straightEdges->straightEdgeCoordinates.start.y;
 endX=edgereport->straightEdges->straightEdgeCoordinates.end.x;
 endY=edgereport->straightEdges->straightEdgeCoordinates.end.y;

 

 

 

the red color code may cause the Access error!

Thanks for any help......