Ticket #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
comment:2 Changed 3 years ago by jmr@…
- Keywords opencv 2.1.0 memory leak removed
- Priority changed from High to Normal
- Cc gonzalo.llorente@… removed
- Owner changed from macports-tickets@… to stante@…
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 3 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.


Cc Me!