Memory Leak from iterating Opencv frames

前端 未结 5 2097
囚心锁ツ
囚心锁ツ 2020-12-14 20:20

I am using the java wrapper of OpenCV. I tried to write an Iterator over frames of a film. My problem is that the iterator is a huge memory leak. Here is a very simplified v

5条回答
  •  醉话见心
    2020-12-14 21:09

    System.gc(); doesn't work for me.

    I have add the line:

    System.runFinalization();

    A Codesnippet:

        startGC--;
        if (startGC==0) {
            System.gc();
            System.runFinalization();
            startGC=100;
        }
    

提交回复
热议问题