{"action":"reopened","issue":{"url":"https://api.github.com/repos/Itseez/opencv/issues/5715","labels_url":"https://api.github.com/repos/Itseez/opencv/issues/5715/labels{/name}","comments_url":"https://api.github.com/repos/Itseez/opencv/issues/5715/comments","events_url":"https://api.github.com/repos/Itseez/opencv/issues/5715/events","html_url":"https://github.com/Itseez/opencv/issues/5715","id":118983466,"number":5715,"title":"memory leak with videocapture, memory goes up with the function of read(image)","user":{"login":"XuqxMaritech","id":16028098,"avatar_url":"https://avatars.githubusercontent.com/u/16028098?v=3","gravatar_id":"","url":"https://api.github.com/users/XuqxMaritech","html_url":"https://github.com/XuqxMaritech","followers_url":"https://api.github.com/users/XuqxMaritech/followers","following_url":"https://api.github.com/users/XuqxMaritech/following{/other_user}","gists_url":"https://api.github.com/users/XuqxMaritech/gists{/gist_id}","starred_url":"https://api.github.com/users/XuqxMaritech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XuqxMaritech/subscriptions","organizations_url":"https://api.github.com/users/XuqxMaritech/orgs","repos_url":"https://api.github.com/users/XuqxMaritech/repos","events_url":"https://api.github.com/users/XuqxMaritech/events{/privacy}","received_events_url":"https://api.github.com/users/XuqxMaritech/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Itseez/opencv/labels/affected:%20master","name":"affected: master","color":"ededed"},{"url":"https://api.github.com/repos/Itseez/opencv/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/Itseez/opencv/labels/category:%20highgui-video","name":"category: highgui-video","color":"ededed"},{"url":"https://api.github.com/repos/Itseez/opencv/labels/priority:%20low","name":"priority: low","color":"AA9739"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-26T06:49:49Z","updated_at":"2015-12-11T09:08:38Z","closed_at":null,"body":"Hello! I am using opencv 3.0 beta with visual studio 2013 under windows 7 and 64bit. I downloaded opencv3.0 beta for windows from http://opencv.org/downloads.html. \r\nThe following is the code I am using to capture the video from rtsp stream and then save some frames every several minutes. It has no problem to capture and read the stream. But I found, the function \"read(InputArrray Image)\" cause the memory leak. The memory goes up slowly, about one MB for two or three hours. But it keep going up. I am using it for severy months continually. so it is seriouly problem for me. The following is my code for test. Please help me find out where is my problem with these code. Thanks a lot!\r\nint main()\r\n{\r\n\tstring fileNameSave;\r\n\tstring URLName;\r\n\r\n\tBOOL stop = FALSE;\r\n\tBOOL saveFrame = TRUE;\r\n\tBOOL got_frame = FALSE;\r\n\tstring fileSave = \"saveFrame.jpg\";\r\n\tURLName = \"rtsp://username:password@IP adress:554/h264/ch1/main/av_stream\";\r\n\tVideoCapture capture;\r\n\tMat frame;\r\n\tcapture.open(URLName);\r\n\tif (!capture.isOpened()){\r\n\t\tcout << \" channel 1st has error \" << endl;\r\n\t}\r\n\twhile (!stop){  \r\n\t\tgot_frame = capture.read(frame); //here the memory keep goes up\r\n\t\t//save the frame every minute locally\r\n\t\tif (saveFrame == TRUE){\r\n\t\t\tif (got_frame){\r\n\t\t\t\timwrite(fileSave, frame);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tcapture.release();\r\n\treturn 0;\r\n}\r\n"}}