[MacPorts] #26642: opencv 2.1.0 memory leaks
MacPorts
noreply at macports.org
Sun Sep 26 14:15:15 PDT 2010
#26642: opencv 2.1.0 memory leaks
----------------------------------------+-----------------------------------
Reporter: gonzalo.llorente@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: High | Milestone:
Component: ports | Version: 1.9.1
Keywords: opencv 2.1.0 memory leak | Port: opencv
----------------------------------------+-----------------------------------
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.
--
Ticket URL: <https://trac.macports.org/ticket/26642>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list