Opened 14 years ago

Closed 13 years ago

#26642 closed defect (fixed)

opencv 2.1.0 memory leaks

Reported by: gonzalo.llorente@… Owned by: stante@…
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc: gonzalo@…
Port: opencv

Description

Hi,

I think there must be something wrong with function cvShowImage(). A simple piece of code that plays a video like (see below) just keeps allocating memory all the time. This same program compiled against port opencv 2.0.0 just takes 30 MB and stays around that amount of memory.

code:

#include <stdio.h> #include "highgui.h"

int main(int argc, char* argv[]) {

if (argc != 2) {

printf("%s <file>\n", argv[0]); return -1;

}

char *title = argv[1];

cvNamedWindow(title, CV_WINDOW_AUTOSIZE); CvCapture *capture = cvCreateFileCapture(argv[1]); IplImage *frame;

while (1) {

frame = cvQueryFrame(capture); if (!frame)

break;

cvShowImage() posible memory leak... cvShowImage(title, frame); char c = cvWaitKey(33); if (c == 27)

break;

}

cvReleaseCapture(&capture); cvDestroyWindow(title); return 0;

}

If I comment out the line that show the image on screen (cvShowImage()) the behaviour of the memory is right. So I think that maybe something is wrong with this function...

I don't know if this should be reported to the opencv developers... Thanks for the help.

Change History (5)

comment:1 Changed 14 years ago by gonzalo.llorente@…

Cc: gonzalo.llorente@… added

Cc Me!

comment:2 Changed 14 years ago by jmroot (Joshua Root)

Cc: gonzalo.llorente@… removed
Keywords: opencv 2.1.0 memory leak removed
Owner: changed from macports-tickets@… to stante@…
Priority: HighNormal

Please remember to cc the maintainer. As per the ticket guidelines, the High priority is reserved for the use of MacPorts team members.

comment:3 Changed 14 years ago by gonzalo.llorente@…

Hi,

This issue has been reported months ago. Someone pointed out a fix ticket in the opencv list.

https://code.ros.org/trac/opencv/changeset/3253

is this patch applied in latest opencv macport?

regards, gonzalo.

comment:4 Changed 13 years ago by stromnov (Andrey Stromnov)

This ticket, probably, outdated by #27605.

comment:5 Changed 13 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: newclosed

Resolving as fixed by upgrading to version 2.2.

Note: See TracTickets for help on using tickets.