Ask Your Question

kevin.gurney's profile - activity

2018-03-19 05:51:31 -0500 received badge  Popular Question (source)
2014-10-31 10:02:56 -0500 commented question Valgrind Reports Possible Memory Leak using OpenCV C++ Libraries

OK, thank you for clarifying! I apologize for the confusion. This may be beyond the scope of this question, but is there any obvious reason that I am missing as to why the native Linux libraries would be leaking memory?

2014-10-30 20:46:03 -0500 commented question Valgrind Reports Possible Memory Leak using OpenCV C++ Libraries

It is not particularly apparent to me where the possible leaks are occurring based on the output of Valgrind.

2014-10-30 10:40:39 -0500 commented question Valgrind Reports Possible Memory Leak using OpenCV C++ Libraries

I assumed that the possible losses are probably not actually losses at all, but it seems a bit strange that there are even "possible" leaks being reported by Valgrind. The output from running Valgrind with the --leak-check=full flag can be viewed here: http://pastebin.com/GGD7d0NP.

2014-10-30 08:45:45 -0500 received badge  Editor (source)
2014-10-29 14:26:10 -0500 asked a question Valgrind Reports Possible Memory Leak using OpenCV C++ Libraries

I have created a very simple program, which essentially does nothing in particular other than include the opencv2/core/core.hpp header.

However, when I run the program using Valgrind it always reports "possibly lost: 4,676 bytes in 83 blocks" seeming to suggest that there may be a memory leak in my program or the OpenCV C++ bindings.

#include <opencv2/core/core.hpp>

int main() {
    return 0;
}

The output from Valgrind is:

==30842== Memcheck, a memory error detector
==30842== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==30842== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==30842== Command: ./opencv-testing
==30842== 
==30842== 
==30842== HEAP SUMMARY:
==30842==     in use at exit: 307,778 bytes in 1,401 blocks
==30842==   total heap usage: 2,628 allocs, 1,227 frees, 400,413 bytes allocated
==30842== 
==30842== LEAK SUMMARY:
==30842==    definitely lost: 0 bytes in 0 blocks
==30842==    indirectly lost: 0 bytes in 0 blocks
==30842==    possibly lost: 4,676 bytes in 83 blocks
==30842==    still reachable: 303,102 bytes in 1,318 blocks
==30842==         suppressed: 0 bytes in 0 blocks
==30842== Rerun with --leak-check=full to see details of leaked memory
==30842== 
==30842== For counts of detected and suppressed errors, rerun with: -v
==30842== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Is OpenCV really leaking memory, or is Valgrind just misinterpreting the memory management system that OpenCV uses? Is there a way to prevent these "possibly lost" memory errors from occurring when using OpenCV?

2014-10-01 12:34:07 -0500 received badge  Scholar (source)
2014-10-01 12:34:06 -0500 received badge  Supporter (source)
2014-10-01 12:33:59 -0500 commented answer Constant Time Random Access to Video Frames

Thank you for clarifying.

2014-09-30 12:20:27 -0500 commented answer Constant Time Random Access to Video Frames

Is this operation O(n)? i.e. do you have to walk through each of the frames from the beginning of the video in order to move to another frame with trackbar?

2014-09-29 21:32:02 -0500 asked a question Constant Time Random Access to Video Frames

Is it possible to access a frame at a particular offset in a video using a constant time O(1) operation, similar to the constant time random access of an array by index? If so, how can this be achieved in OpenCV 2.4.9?